I have two questions...
1) How does decisions build the Electoral List? All users with the permissions to vote in decisions?
2) Decisions is currently stating some user don't exist when they do. Why is this and how can it be fixed?
I have two questions...
1) How does decisions build the Electoral List? All users with the permissions to vote in decisions?
2) Decisions is currently stating some user don't exist when they do. Why is this and how can it be fixed?
Comments
Comment #1
LenInkster-1 commentedI have found no way of adding a user to the electoral list either. I gave up and removed the module, and started using the Advanced Poll module instead.
Comment #2
Anonymous (not verified) commentedCheck this issue: #365338: Users not showing up on electoral list after adding. I have posted a solution to that one, and it might be a solution to this problem too.
Comment #3
anarcat commentedSee #365338: Users not showing up on electoral list after adding
Comment #4
snowmountain commentedI found this problem with Drupal 6, and seem to have fixed it.
A SQL query was checking for the existence of users in the database, and used this code:
SELECT uid
FROM {users} WHERE name="%s"
The code is around line 459 in decisions.module,
// $Id: decisions.module,v 1.202 2008/12/05 03:48:02 anarcat Exp $
Note the %s - this did not have a value in this context. It looks as though it should be %user - to which I changed it, and it worked! Users could then be added, and would show up on the electoral list.
This worked:
SELECT uid
FROM {users} WHERE name="%user"
That seems to fix it!!!
Also, I see several other places in the code where %s appears; I don't have time now to look all these other instances, but perhaps this will be a clue to someone else.
Below is more code to help locate it in context:
function decisions_electoral_list_form_validate($form, &$form_state) {
// ... much code skipped here...
if ($add_user) {
// Check that the user exists
if (db_fetch_object(db_query('SELECT uid FROM {users} WHERE name="%s"', $add_user))) {
form_set_error('electoral_list][add_user', t('User %user does not exist.', array('%user' => $add_user)));
return FALSE;
}
}