If a poll form is submitted without selecting any of the poll options, the #default_value = -1 for the choices element causes the error message "An illegal choice has been detected. Please contact the site administrator" to be produced instead of the proper error "Your vote could not be recorded because you did not select any of the choices."
Remove the #default_value.
|Task||Novice task?||Contributor instructions||Complete?|
|Create a patch||Novice||Instructions||Yes|
|Add automated tests||Novice||Instructions||Yes|
|Manually test the patch||Novice||Instructions||Yes|
|Embed before and after screenshots in the issue summary||Novice||Instructions||Yes|
|Review patch to ensure that it fixes the issue, stays within scope, is properly documented, and follows coding standards||Instructions||Yes|
User interface changes
Original report by @gargsuchi
I have Drupal 7.15 installed.
I am using panels to build my site - so my poll node is rendered using panel.
If I don't select any of the choices and press the vote button, I get this error:
An illegal choice has been detected. Please contact the site administrator.
Instead of the normal:
Your vote could not be recorded because you did not select any of the choices.
Any idea why this might be happening?
|PASSED: [[SimpleTest]]: [MySQL] 41,039 pass(es).|
|PASSED: [[SimpleTest]]: [MySQL] 40,945 pass(es).|
|FAILED: [[SimpleTest]]: [MySQL] 40,949 pass(es), 1 fail(s), and 0 exception(s).|