user warning: Field 'confirm_code' doesn't have a default value query: INSERT INTO multiple_email (uid, email, time_registered, confirmed) SELECT uid, mail, created, 1 FROM users WHERE uid != 0 AND mail != '' GROUP BY mail

What do I need to do?

mrweaver

Comments

danepowell’s picture

Yeah, either confirm_code needs to have a default value, or it needs to be able to be NULL, or that query needs to specify a value. I think it should probably just be allowed to be NULL.

danepowell’s picture

Priority: Normal » Major

Actually this is a major issue, since it breaks automated tests for any module that depends on multiple_email.

bledbetter’s picture

Issue summary: View changes

I get a similar error on installation:

PDOException: SQLSTATE[42803]: Grouping error: 7 ERROR: column "drupal7_doingdba_users.uid" must appear in the GROUP BY clause or be used in an aggregate function LINE 5: uid, ^: INSERT INTO {multiple_email} (uid, email, time_registered, confirmed) SELECT uid, mail, created, 1 FROM {users} WHERE uid != 0 AND mail != '' GROUP BY mail ; Array ( ) in multiple_email_install() (line 28 of .../doc/sites/all/modules/multiple_email/multiple_email.install).

Drupal 7.28, Postgresql 9.2.2. Removing the "GROUP BY" clause on line 27 seems to fix this particular problem; not sure what the implications are (also not sure how you would get duplicate data from the default users table).

  • drumm committed 407ed81 on 7.x-1.x
    Issue #1238180: Remove unnecessary GROUP BY
    
drumm’s picture

Version: 6.x-1.3 » 7.x-1.x-dev
Assigned: Unassigned » drumm
Status: Active » Fixed

I removed the GROUP BY clause. Since mail should be unique, it isn't needed. If it weren't unique, this will select an effectively random user to get the email, which would be bad too.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.