以编程方式更改 Webform 模块中的提交者用户

发布于 2024-10-05 02:24:57 字数 457 浏览 0 评论 0原文

我自动为按照 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

染年凉城似染瑾 2024-10-12 02:24:57

我的建议是执行 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文