I have a content type with a long name. When I go to assign an action for that content type, I get an error like:

user warning: Data too long for column 'op' at row 1 query: INSERT INTO trigger_assignments values ('workflow', 'workflow-cv_partner_of_the_month-2', '1', 1) in C:\apache-htdocs\htdocs_vhost-classic\modules\trigger\trigger.admin.inc on line 206.

because "op" is only 32 characters. I have a trigger.install patch for making this 64 characters, but I don't know if it will be accepted into core.

An alternative would be to get rid of the "workflow-" in front of the op string. Or, perhaps just shortening it to "wf-". But, these alternatives still won't always fix the problem, because node->type can be 32 characters. So, if the node->type is the full 32 characters long and no prefix was used, the workflow would try to use [type]-[num] as the "op" which is still too long.

The only other alternative I see to patching the core would be to truncate the node->type when used for the op, but again this could lead to issues where one content type is a substring of another.

Should I add this issue to the drupal 6 issue queue?

CommentFileSizeAuthor
#1 trigger.install.patch740 byteskristen pol
trigger.install.patch696 byteskristen pol

Comments

kristen pol’s picture

StatusFileSize
new740 bytes

I tried altering my trigger_assignments table with 64 and got this mysql error:

#1071 - Specified key was too long; max key length is 1000 bytes

(this is a long-standing mysql issue that limits the key: http://bugs.mysql.com/bug.php?id=4541)

so max I was able to use was 46. So, this is a new patch with varchar(46).

This would give the workflow module an extra (46-32=14) characters for the "op" field. "workflow-" is 9 characters, so that leaves plenty of chars for the numbers.

jwarner’s picture

Subscribing

westbywest’s picture

Subscribing. I had a long name for a content type ("workflow-dba_video_block_content-3") which exceeded the 32char limit on trigger_assignments.op column.

Suggest putting the values for op in their own table i.e. "trigger_ops," linked to trigger_assignments.op via numerical keys?

deekayen’s picture

deekayen’s picture

Project: Workflow » Drupal core
Version: 6.x-1.1 » 6.x-dev
Component: Code » trigger.module
wickwood’s picture

subscribing

gagarine’s picture