以编程方式更改 Webform 模块中的提交者用户
我自动为按照 http://www.mikewagan.net/2010/10/drupal-create-user-accounts-through-the-webform-module/
这一切都工作正常,有一个小问题:Webform提交数据应该更改为代表正确的提交者(我新创建的用户),目前它与未经身份验证的用户绑定。
我在“附加处理”字段中尝试了 $form['details']['uid']['#value'] = $account->uid;
,但这似乎不起作用。
我必须修改 Webform 提交数据的哪一部分才能实现此目的?
I automatically create users for visitors that submit my webforms as per http://www.mikewagan.net/2010/10/drupal-create-user-accounts-through-the-webform-module/
This all works fine, with one little problem: The Webform submission data should be changed as to represent the correct submitter (my newly created user), currently it is tied to the unauthenticated user.
I tried $form['details']['uid']['#value'] = $account->uid;
in the Additional Processing field, but that does not seem to work.
Which part of Webform's submission data do i have to massage to make this happen?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我的建议是执行 hook_nodeapi ,并在创建节点之前编辑节点内的提交者。
检查nodeapi给你的状态:
http ://api.drupal.org/api/drupal/developer--hooks--core.php/function/hook_nodeapi/6
My suggestion is to perform a hook_nodeapi , and edit the submitter inside the node right before it is created.
check the states nodeapi gives you here:
http://api.drupal.org/api/drupal/developer--hooks--core.php/function/hook_nodeapi/6