Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I created a simple content type with a pollfield and enabled it to anonymous users. I filled out one as anonymous and got this error message:
Error
The website encountered an unexpected error. Please try again later.
Error message
Notice: Undefined variable: table in pollfield_save_vote_record() (line 607 of /home/par/www/d_7/sites/all/modules/pollfield/pollfield.module).
PDOException: SQLSTATE[HY093]: Invalid parameter number: parameter was not defined: INSERT INTO {pollfield_votes} (nid, field_table, field_name, uid, delta, hostname, field_name_delta, cookie) VALUES (:nid, :table, :field_name , :uid, :choice, :hostename, :delta, :cookie); Array ( [:nid] => 58 [:table] => [:field_name] => field_poll [:uid] => 0 [:choice] => 1 [hostname:] => 127.0.0.1 [:delta] => 0 [:cookie] => 0 ) in pollfield_save_vote_record() (line 608 of /home/par/www/d_7/sites/all/modules/pollfield/pollfield.module).
Comments
Comment #1
kappaluppa CreditAttribution: kappaluppa commentedI'm getting this error too. Any ideas on it? pollfield works perfectly for us, otherwise. Fixing this would allow us to use it.
Thanks!
K
Comment #2
kappaluppa CreditAttribution: kappaluppa commentedI am at beginner level with php, but I was mucking around with the module and I made some changes that will allow anon voters to vote without that error showing up (i have new error, but they can still vote).
Here are the changes I made to pollfield.module:
(although I don't know how to write patches yet, I'm trying to give the changes in 'patch style' (with layman comments following, lol) )
layman's explanation:
I am getting this error, although the voting still happens
Comment #3
kappaluppa CreditAttribution: kappaluppa commentedone other change i left out...
Comment #4
BigEd CreditAttribution: BigEd commentedI am getting the same error, as this fixed then?