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.

CommentFileSizeAuthor
#13 395132-D6.patch562 bytesjhodgdon
#9 395132.patch651 bytesarianek
#4 395132.patch541 bytesjhodgdon
poll_fn_rm.patch737 bytesjhodgdon

Comments

kscheirer’s picture

Category: bug » task
Issue tags: +Needs documentation

This 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.

kscheirer’s picture

Status: Active » Needs work
kscheirer’s picture

Title: Remove poll_node_form_submit() from poll.module? » documentation: poll_node_form_submit()

better title

jhodgdon’s picture

Component: poll.module » documentation
Category: task » bug
Status: Needs work » Needs review
StatusFileSize
new541 bytes

Here 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.

Status: Needs review » Needs work

The last submitted patch failed testing.

jhodgdon’s picture

Status: Needs work » Needs review

Setting 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).

Status: Needs review » Needs work

The last submitted patch failed testing.

jhodgdon’s picture

Status: Needs work » Needs review

Test bot problem

arianek’s picture

StatusFileSize
new651 bytes

patch applied cleanly to D7 HEAD, re rolled for bot

jhodgdon’s picture

Issue tags: -Needs documentation +Novice

I think a novice could review this patch, as it is doc only.

JuliaKM’s picture

Status: Needs review » Reviewed & tested by the community

The patch applied cleanly. It is great to have the confusing reference to hook_submit removed.

webchick’s picture

Version: 7.x-dev » 6.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Committed to HEAD, thanks!

For whatever reason, this did not apply cleanly to 6.x. Needs a quick re-roll.

jhodgdon’s picture

StatusFileSize
new562 bytes

Here's a patch for Drupal 6.x.

jhodgdon’s picture

Status: Patch (to be ported) » Needs review
JuliaKM’s picture

Status: Needs review » Reviewed & tested by the community

The D6 patch applied cleanly.

gábor hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

I'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.

Status: Fixed » Closed (fixed)
Issue tags: -Novice

Automatically closed -- issue fixed for 2 weeks with no activity.