There is a bug in the user_register_notify.module which yields this error upon new user registration:
user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '3,0,0,0,0' at line 1 query: SELECT mail FROM users AS u INNER JOIN users_roles AS r ON u.uid = r.uid WHERE r.rid IN('')3,0,0,0,0 in D:\****************
user warning: Data too long for column 'type' at row 1 query: INSERT INTO watchdog (uid, type, message, severity, link, location, referer, hostname, timestamp) VALUES (0, 'user_register_notify', '', 0, '', 'http://drupal52.local/user/register', 'http://drupal52.local/user/register', '66.185.109.71', 1240417865) in D:\*********\includes\database.mysqli.inc on line 156.
user warning: Data too long for column 'type' at row 1 query: INSERT INTO watchdog (uid, type, message, severity, link, location, referer, hostname, timestamp) VALUES (0, 'user_register_notify', '', 0, '', 'http://drupal52.local/user/register', 'http://drupal52.local/user/register', '66.185.109.71', 1240417865) in D:\************\includes\database.mysqli.inc on line 156.
---
On line 189 of user_register_notify.module,
//$result = db_query("SELECT mail FROM {users} AS u INNER JOIN {users_roles} AS r ON u.uid = r.uid WHERE r.rid IN('%s')". $roles);
Should read:
$result = db_query("SELECT mail FROM {users} AS u INNER JOIN {users_roles} AS r ON u.uid = r.uid WHERE r.rid IN('{$roles}')");
The problem was the mix-match of (s)printf style formatting-without an inner call to (s)printf- in addition to invalid syntax (dot operator instead of comma). No worries!
Comments
Comment #1
rmiddle commentedComment #2
rmiddle commentedI want you to talk to the security team and ask is this is a good fix?
Comment #3
mlissner commentedI just got bit by this bug. Is there any fix on the horizon?
Comment #4
rmiddle commentedComment #6
Den tyska hustomten commentedHej
I´ve opend admin user_registry_notify ang h´ve got the following errormessage
* Notice: Constant USER_REGISTER_NOTIFY_SUBJECT already defined in require_once() (Zeile 9 von /hsphere/local/home/jmgse/den-tyska-hustomte.se/drupal/sites/all/modules/user_register_notify/user_register_notify.admin.inc).
* Notice: Constant USER_REGISTER_NOTIFY_BODY already defined in require_once() (Zeile 10 von /hsphere/local/home/jmgse/den-tyska-hustomte.se/drupal/sites/all/modules/user_register_notify/user_register_notify.admin.inc).
With best regards
Jörg
Comment #7
nospamhere4me commentedI am seeing the exact same problem. My site's email address provided under the Administration->Configuration->System is a no-reply email address and would like to use the User Register Notify module to send an email to administrators of the site when new users register.
The exact error I am seeing is
Notice: Constant USER_REGISTER_NOTIFY_SUBJECT already defined in require_once() (line 9 of /var/www/Sites/drupal-7.0/sites/all/modules/user_register_notify/user_register_notify.admin.inc).
Notice: Constant USER_REGISTER_NOTIFY_BODY already defined in require_once() (line 10 of /var/www/Sites/drupal-7.0/sites/all/modules/user_register_notify/user_register_notify.admin.inc).
Thanks.
Comment #8
rmiddle commentedThe Drupal 7 version has been fixed. The original issue is related to only 1 role is supported. I am going to make this one as duplicate.
Thanks
Robert