I am getting an error when executing an action based on an assigned trigger. The function appears to work. All users in the specified group receive the email messages. The issue is that when creating a new story the author gets the warning message below on the resulting page.
Drupal 6.4
Postgres 8.1
* warning: pg_query() [function.pg-query]: Query failed: ERROR: value too long for type character varying(16) in /var/www/drupal-6.4/includes/database.pgsql.inc on line 138.
* user warning: query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (3, 'action_email_role', 'Sent email to %recipient', 'a:1:{s:10:"%recipient";s:16:"james@######.com";}', 5, '', 'http://##############.net/node/add/story', 'http://##############.net/node/add/story', '67.9.144.167', 1222228843) in /var/www/drupal-6.4/modules/dblog/dblog.module on line 144.
* warning: pg_query() [function.pg-query]: Query failed: ERROR: value too long for type character varying(16) in /var/www/drupal-6.4/includes/database.pgsql.inc on line 138.
* user warning: query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (3, 'action_email_role', 'Sent email to %recipient', 'a:1:{s:10:"%recipient";s:21:"brandon@########.com";}', 5, '', 'http://##############.net/node/add/story', 'http://##############.net/node/add/story', '67.9.144.167', 1222228843) in /var/www/drupal-6.4/modules/dblog/dblog.module on line 144.
* warning: pg_query() [function.pg-query]: Query failed: ERROR: value too long for type character varying(16) in /var/www/drupal-6.4/includes/database.pgsql.inc on line 138.
* user warning: query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (3, 'action_email_role', '!emailed users emailed successfuly.', 'a:1:{s:8:"!emailed";i:2;}', 5, '', 'http://##############.net/node/add/story', 'http://##############.net/node/add/story', '67.9.144.167', 1222228843) in /var/www/drupal-6.4/modules/dblog/dblog.module on line 144.
This may be due to the fact that MySQL will quietly truncate the string while PostgreSQL throws an error because 'action_email_role' is 17 characters but the type column is only a varchar(16).
Comments
Comment #1
becw commentedHuh, interesting. I can't find any guidelines on what to use in the watchdog 'type' field; I guess I'll just continue to use the module name but trim it to 16 characters.
Comment #2
becw commentedI've trimmed the watchdog 'type' parameter to 16 characters in http://drupal.org/cvs?commit=142314
The change should be available in the -dev release when it gets packaged tonight, or in the DRUPAL-6--1 branch. Thanks for pointing this out!
Comment #3
becw commentedfixed in -dev, as mentioned above.
Comment #4
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.