Drupal 7 匿名用户表单提交Drupal7

Drupal 7 匿名用户表单提交Drupal7,drupal-7,user-registration,Drupal 7,User Registration,我有一种情况,在完成基本注册后,用户被重定向到一个页面,他需要填写一个小表单 我的目标是实现hook\u user\u insert和hook\u菜单来完成类似的操作 function registration_user_insert(&$edit, $account, $category){ drupal_goto('splan/'.$edit['uid']); } function registration_menu() { $items['splan/%'] = array( '

我有一种情况,在完成基本注册后,用户被重定向到一个页面,他需要填写一个小表单

我的目标是实现
hook\u user\u insert
hook\u菜单
来完成类似的操作

function registration_user_insert(&$edit, $account, $category){
drupal_goto('splan/'.$edit['uid']);
}

function registration_menu() {
$items['splan/%'] = array(
'title' => 'Select a Plan',
'page callback' => 'drupal_get_form',
'page arguments' => array('selectplan_form'),
'access callback' => TRUE,
'type' => MENU_CALLBACK
);
return $items;
}
在selectplan\u表单中,我将定义新表单,然后使用uid将数据保存到用户表中

现在发生的事情是在提交基本用户注册表单之后,发生了到splan/uid的重定向,但我也得到了以下错误

You are not authorized to access this page.
现在我已更改权限以允许anony。用户创建和编辑webform,但问题仍然存在


请帮忙

尝试删除
'access callback'=>TRUE,
并添加
'access arguments'=>array('access content'),


也许您忘记清除缓存了?

用户注册后是否必须填写您所指的表单?如果是这样的话,情况就有点棘手了。无论哪种方式,将drupal_goto放入user_insert钩子都会中断注册过程。如果您的表单不要求用户先注册,您只需更改注册表单以包含表单上的任何额外字段。要做到这一点,您需要从_alter()实现一个钩子: