When I add 'Signup: User: Email Address' to a view, i get the following error:

user warning: Unknown column 'mail' in 'field list' query: SELECT node.nid AS nid, signup.forwarding_email AS signup_forwarding_email, signup.nid AS signup_nid, node.uid AS node_uid, signup.status AS signup_status, signup_log.form_data AS signup_log_form_data, signup_log.sid AS signup_log_sid, signup_log.uid AS signup_log_uid, signup_log.anon_mail AS signup_log_anon_mail, mail FROM node node LEFT JOIN signup_log signup_log ON node.nid = signup_log.nid LEFT JOIN signup signup ON node.nid = signup.nid WHERE signup_log.sid != -1 in /var/accounts/CN20101016/www/sites/all/modules/views-6.x-2.12/views/includes/view.inc on line 775.

I would be really appreciated if I could have the email field working for administrative purposes for a festival coming up in 3 days..
Could this be due to an incompatible version of views or something?

#6 signup_views_1195322.txt3.27 KBpfrilling
Membership dollars fund testing for the Drupal project. Drupal Association Learn more


endless_wander’s picture

Priority: Normal » Major

I'm getting the same error in a View when adding User: Email Address.

user warning: Unknown column 'mail' in 'field list' query: SELECT signup_log.sid AS sid, signup_log.nid AS signup_log_nid, signup_log.uid AS signup_log_uid, signup_log.form_data AS signup_log_form_data, signup_log.anon_mail AS signup_log_anon_mail, mail, signup_log.signup_time AS signup_log_signup_time FROM signup_log signup_log in /sites/all/modules/views/includes/view.inc on line 775.

Using Signup 6.x-1.0 and Views 6.x-2.12

endless_wander’s picture

The problem is that the View is looking for a column called 'mail' in the signup_log table. This column doesn't exist.

Temporarily bypassed the issue by just adding an empty column in my signup_log table called 'mail'.

Don't know enough about Views to know how to alter the way the SQL query is being created so that it doesn't look for the 'mail' column.

endless_wander’s picture

Now if I add a relationship to the View, my SQL query fails again because the 'mail' column is ambiguous:

user warning: Column 'mail' in field list is ambiguous query: SELECT signup_log.sid AS sid, node_signup_log__signup_log.uid AS node_signup_log__signup_log_uid, node_signup_log__signup_log.anon_mail AS node_signup_log__signup_log_anon_mail, mail, node_signup_log__signup_log.form_data AS node_signup_log__signup_log_form_data, node_signup_log__signup_log.signup_time AS node_signup_log__signup_log_signup_time, node_signup_log__signup_log.nid AS node_signup_log__signup_log_nid, node_signup_log__signup_log.sid AS node_signup_log__signup_log_sid FROM signup_log signup_log LEFT JOIN node node_signup_log ON signup_log.nid = node_signup_log.nid LEFT JOIN signup_log node_signup_log__signup_log ON node_signup_log.nid = node_signup_log__signup_log.nid in /sites/all/modules/views/includes/view.inc on line 775.

endless_wander’s picture

This line in /sites/all/modules/signup/views/handlers/signup_handler_field_signup_user_email.inc seems to be the troublemaker:

$this->aliases['users_mail'] = $this->query->add_field($this->users_alias, 'mail');

Not sure if this is required for other things, but commenting this out makes my View work.

Any advice or suggestions?

pfrilling’s picture

We too experienced this problem. We were able to work around the problem by adding the 'Signup: User' relationship to the view. This relationship joined the query with the users table, which allowed the missing 'mail' column to be found.

pfrilling’s picture

3.27 KB

Attached is an export of the view we are successfully using.