Submitting content type form destroys poll results
webchick - September 20, 2008 - 07:56
| Project: | Drupal |
| Version: | 7.x-dev |
| Component: | poll.module |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
This is bizarre.
0. Enable poll module.
1. Enable the Recent polls block.
2. Create a poll.
3. Vote on the poll.
4. Go to the Admin > Site building > Content types
5. Hit "edit" on, say, Article, and fill in some submission guidelines.
6. Save the form, and get this:
* notice: Undefined property: stdClass::$allowvotes in /Applications/MAMP/htdocs/core/modules/poll/poll.module on line 546.
* notice: Undefined property: stdClass::$choice in /Applications/MAMP/htdocs/core/modules/poll/poll.module on line 680.
* warning: Invalid argument supplied for foreach() in /Applications/MAMP/htdocs/core/modules/poll/poll.module on line 680.
* notice: Undefined property: stdClass::$choice in /Applications/MAMP/htdocs/core/modules/poll/poll.module on line 688.
* warning: Invalid argument supplied for foreach() in /Applications/MAMP/htdocs/core/modules/poll/poll.module on line 688.Then, it looks like the poll's votes are cleared or something because there's nada in the right sidebar.
Can anyone else reproduce this?

#1
Oh, wait. It's doing a node_load() of the latest poll where the recent poll results used to be..? And saying there are 0 votes?
Please excuse my horrid colour scheme. ;)
#2
Ok, more weirdness.
So those errors show up on every page of the site... until! You CLEAR THE CACHE at admin/settings/performance. Then suddenly everything's hunky dory. Huh.
Anyway, I would say spewing errors all over your site and pretending to delete your votes qualifies as a critical bug. :P
#3
Have an open issue here for similar notices, although steps to reproduce are different: #277162: Undefined property when viewing poll results from two sessions with the same user
#4
The fact that editing a poll clears results is not really new (you can test it on gdo...). The strange behavior of the block looks related to block caching.
#5
Editing a poll clearing results has been fixed in Drupal 7 and 6 though (and there's a waiting backport for 5).
#6
I followed the steps in #1 and could not reproduce. Setting to normal priority until someone can reproduce the error.