Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby-on-rails-4/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Drupal 6-用户配置文件表单未显示_Drupal_Drupal 6 - Fatal编程技术网

Drupal 6-用户配置文件表单未显示

Drupal 6-用户配置文件表单未显示,drupal,drupal-6,Drupal,Drupal 6,我试图使用下面的代码在Drupal6中显示我的用户配置文件的“注册信息”组。执行此代码时,将显示配置文件表单中的字段标签,但不会显示输入字段。页面源没有表单标记。此代码适用于D6的其他安装-因此我相信它可以工作。你知道从哪里开始调试吗 global $user; $uid = $user->uid; if ($uid > 0) { include_once drupal_get_path('module', 'user') . '/user.pages.inc'; $pro

我试图使用下面的代码在Drupal6中显示我的用户配置文件的“注册信息”组。执行此代码时,将显示配置文件表单中的字段标签,但不会显示输入字段。页面源没有表单标记。此代码适用于D6的其他安装-因此我相信它可以工作。你知道从哪里开始调试吗

global $user; 
$uid = $user->uid;
if ($uid > 0) {  
include_once drupal_get_path('module', 'user') . '/user.pages.inc';  
$profile =  profile_load_profile($user);
print(drupal_get_form('user_profile_form', $user, 'Registration Information'));
}

看起来您正在使用profile\u load\u profile函数,但在下一行中您没有使用该配置文件。而是使用全局$user。我在这里猜测,但你不是因为在下一行需要它而加载配置文件吗

因此,不是:

print(drupal_get_form('user_profile_form', $user, 'Registration Information'));
尝试:


谢谢大家。唯一起作用的是:

global $user;
module_load_include('inc', 'user', 'user.pages');
print user_edit($user, 'Registration Information');

profile\u load\u profile通过引用获取$user参数并向其添加字段。将返回值分配给$profile实际上没有任何作用,因为profile\u load\u profile没有返回值…$user绝对是传递给drupal\u get\u formDrupal的正确对象drupal通常通过机器名而不是对象的标题进行操作…尝试将“注册信息”更改为“注册信息”
global $user;
module_load_include('inc', 'user', 'user.pages');
print user_edit($user, 'Registration Information');