Advpoll is making use of $_POST['choice'] in _advpoll_insert_choices() as the mean to pass choice data.

This causes problem when an advpoll is not created through a form such as programatically create a poll, cloning the poll or other ways to modify the choices programatically.

In the comment: * Note: we pass choice data via _POST to allow for dynamic addition of choices.

I would suggest for the purpose of dynamic addition of choices to make use of a separate function and make the _advpoll_insert_choices() to take in values from $node or $form_values.

CommentFileSizeAuthor
#1 advpoll-post.patch2.3 KBckng

Comments

ckng’s picture

Status: Active » Needs work
StatusFileSize
new2.3 KB

Attached is the patch for what I needed.
Come to think of it, where and when do 'we pass choice data via $_POST to allow for dynamic addition of choices'?

Perhaps $_POST data could be extracted as $node->choices before calling _advpoll_insert_choices()

pomliane’s picture

Status: Needs work » Closed (won't fix)

This version of Advanced Poll is not supported anymore. The issue is closed for this reason.
Please upgrade to a supported version and feel free to reopen the issue on the new version if applicable.

This issue has been automagically closed by a script.