Project:Action email role
Version:6.x-1.0-beta1
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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

#1

Huh, 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.

#2

I'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!

#3

Status:active» fixed

fixed in -dev, as mentioned above.

--project followup subject--

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

--project followup subject--

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

--project followup subject--

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

--project followup subject--

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

--project followup subject--

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

#4

Status:fixed» closed (fixed)

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