I don't think the poll_node_form_submit() function in modules/poll.module is being used anywhere, so I think it can be removed. At least, there is no other occurrence of the string "poll_node_form_submit" anywhere in the Drupal project that I could find, and I don't think there are any sort of module_invoke_all() type things going on with this function. Probably left over cruft from a previous time when it was being used?
If it is actually being used, it needs a new doc header. The doc header only says "implementation of hook_submit()". There is no hook_submit() in Drupal 7.x, and even if there was, this wouldn't be an implementation of it (wrong name, among other things).
Attaching a patch, in case it can be safely removed.
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | 395132-D6.patch | 562 bytes | jhodgdon |
| #9 | 395132.patch | 651 bytes | arianek |
| #4 | 395132.patch | 541 bytes | jhodgdon |
| poll_fn_rm.patch | 737 bytes | jhodgdon |
Comments
Comment #1
kscheirerThis function is definitely being called when creating or editing a poll node - right after the form is submitted and passes validation. You can't find a direct reference to it since it relies on a somewhat magic function.
You're correct though that the docs need updating. hook_submit() was removed in Drupal 6.
Comment #2
kscheirerComment #3
kscheirerbetter title
Comment #4
jhodgdonHere is a patch to fix the doc header for this function to describe what it actually does.
If accepted, it should also be ported to D6.
Comment #6
jhodgdonSetting back to Needs Review in hopes that the patch will get retested. The test bot was apparently malfunctioning (I had about 7 patches fail in that time period, all were doc, none broke the HEAD install I am pretty sure).
Comment #8
jhodgdonTest bot problem
Comment #9
arianek commentedpatch applied cleanly to D7 HEAD, re rolled for bot
Comment #10
jhodgdonI think a novice could review this patch, as it is doc only.
Comment #11
JuliaKM commentedThe patch applied cleanly. It is great to have the confusing reference to hook_submit removed.
Comment #12
webchickCommitted to HEAD, thanks!
For whatever reason, this did not apply cleanly to 6.x. Needs a quick re-roll.
Comment #13
jhodgdonHere's a patch for Drupal 6.x.
Comment #14
jhodgdonComment #15
JuliaKM commentedThe D6 patch applied cleanly.
Comment #16
gábor hojtsyI've committed this to Drupal 6, although I'd have two nitpicks for those having time to fix up if anyone is interested:
- If I'm getting right, this is called due to how it is named after the form's key, so that "poll_node_form" makes "poll_node_form_submit" called, right? I'm just looking at the static source code and trying to grasp that. This would be useful to document.
- Also, technically, the function is not getting call when a *poll node* is submitted, but when a *poll node form* is submitted.
Anyway, I believe the existing patch already helps clean up a confusion, so committed that.