1. installed advanced poll module with patch described at http://drupal.org/node/110295
2. create content->binary poll
3. filled questions etc....
4. show individual votes is on
5. restrict to electoral list is on
6. clicked preview
7. clicked submit
error:
* warning: pg_query(): Query failed: ERROR: null value in column "quorum" violates not-null constraint in /home/maho/www-maho.pagema.net/longturn/includes/database.pgsql.inc on line 125.
* user warning: query: INSERT INTO advpoll (nid, mode, uselist, active, runtime, maxchoices, algorithm, showvotes, startdate) VALUES (19, 'binary', 1, 1, 0, 0, '', 1, NULL) in /home/maho/www-maho.pagema.net/longturn/includes/database.pgsql.inc on line 144.
* warning: pg_query(): Query failed: ERROR: function find_in_set("unknown", text) does not exist HINT: No function matches the given name and argument types. You may need to add explicit type casts. in /home/maho/www-maho.pagema.net/longturn/includes/database.pgsql.inc on line 125.
* user warning: query: SELECT COUNT(*) AS hit FROM permission JOIN role ON role.rid = permission.rid WHERE FIND_IN_SET(' vote on advpoll', perm) AND role.name = 'authenticated user' in /home/maho/www-maho.pagema.net/longturn/includes/database.pgsql.inc on line 144.
* warning: pg_query(): Query failed: ERROR: function find_in_set("unknown", text) does not exist HINT: No function matches the given name and argument types. You may need to add explicit type casts. in /home/maho/www-maho.pagema.net/longturn/includes/database.pgsql.inc on line 125.
* user warning: query: INSERT INTO advpoll_electoral_list (nid, uid) SELECT '19', u.uid FROM users_roles u, permission p WHERE FIND_IN_SET(' view advpoll', p.perm) AND u.rid = p.rid AND u.uid != 0 in /home/maho/www-maho.pagema.net/longturn/includes/database.pgsql.inc on line 144.
Comments
Comment #1
anders.fajerson commentedDoes this error still exist?
Comment #2
ChrisKennedy commentedI believe we've fixed the quorum error but still need to fix the usage of find_in_set(). It can easily be replaced with a LIKE clause. I'm not sure why this was not used in the first place.
In fact, after looking into this I see a few other issues. For one, the automatic creation of electoral lists has been broken, probably for quite some time, because it uses old permissions. Rather than "vote on advpoll" and "view advpoll" the relevant permissions should now be "vote on polls" and "view polls" - but that second permission should *actually* be "vote on polls" too, anyway. Also we don't properly use braces around the table names, so they won't even work with db prefixes.
BUT, do we even want this functionality to work? It seems like a bad idea to automatically add all eligible voters to an electoral list as it would take a long time to remove them if you only wanted a small subset to be able to vote. So, I think we should just remove that functionality, and instead implement the existing feature request to add voters to the electoral list by role.
Comment #3
anders.fajerson commentedAgree. You remember the discussion we had about the electoral list functionality and what it actually was way back? I think one of the reasons for my difficulties to grok it was the implementation. The electoral list by role makes more sense and seems much more useful.
Comment #4
ChrisKennedy commentedYeah it took me a while to re-remember what the old code did too. I went ahead and removed it.
http://drupal.org/cvs?commit=66091
Comment #5
(not verified) commented