[drupal-devel] [bug] Poll not properly updating who voted
jhriggs
drupal-devel at drupal.org
Fri Apr 1 16:01:57 UTC 2005
Issue status update for http://drupal.org/node/18597
Project: Drupal
Version: cvs
Component: poll.module
Category: bug reports
-Priority: normal
+Priority: critical
Assigned to: Anonymous
Reported by: cprice
Updated by: jhriggs
-Status: fixed
+Status: active
database.mysql and database.pgsql were updated [1], but updates.inc was
not, so upgrades are now broken! The patch included the udpates.inc
changes...
[1] http://drupal.org/cvs?commit=14407
jhriggs
Previous comments:
------------------------------------------------------------------------
March 8, 2005 - 23: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 15, 2005 - 20: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 - 01: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.
------------------------------------------------------------------------
March 20, 2005 - 08:49 : Goba
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.
------------------------------------------------------------------------
March 20, 2005 - 13:11 : Dries
Fixed in HEAD.
More information about the drupal-devel
mailing list