[drupal-devel] [bug] Poll not properly updating who voted

Goba drupal-devel at drupal.org
Sun Mar 20 14:49:44 UTC 2005


Issue status update for http://drupal.org/node/18597

 Project:      Drupal
 Version:      cvs
 Component:    poll.module
 Category:     bug reports
 Priority:     normal
 Assigned to:  Anonymous
 Reported by:  cprice
 Updated by:   Goba
-Status:       fixed
+Status:       patch

Although and upgrade path was provided, the .mysql and .pgsql files were
not changed to reflect the new column names, so new installations will
fail! Please update. No patch attached, since the change is trivial.


Goba



Previous comments:
------------------------------------------------------------------------

March 9, 2005 - 06:35 : cprice

Attachment: http://drupal.org/files/issues/poll_polled.patch (1.74 KB)

Apparently there is some contention between the queue module and the
poll module, so this is only a problem when both modules are enabled.
Both modules use a node->voters variable.  The queue module defines
this as an array, while the poll module defines this as a string.  This
causes the poll module to only update the poll.voted column with the
last user that has voted, so this only disallows the latest voter as
the poll.voted column's data is overwritten after each vote.
The best possible fix would probably be to rename the poll.voted column
to poll.polled and update the code accordingly.  As an interim, I
propose the following patch which modifies the query to SELECT votes as
polled.  This also modifies relevant code to use node->polled instead of
node->voted.  If the database is modified to accomodate the poll.polled
column instead of the poll.voted column, this would then require
minimal code change to sync the code to the database.


------------------------------------------------------------------------

March 16, 2005 - 03:43 : cprice

Attachment: http://drupal.org/files/issues/poll_polled2.patch (2.92 KB)

I've reworked this patch to update the database via update.php and
remove the crude workaround.  So this patch is no longer a crude hack,
but the final solution I proposed previously.


------------------------------------------------------------------------

March 18, 2005 - 08:34 : Steven

I applied this patch to HEAD. I added a PGSQL upgrade path.
Also, your patch contained two tab characters. Please avoid that in the
future.





More information about the drupal-devel mailing list