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?
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | trigger.install.patch | 740 bytes | kristen pol |
| trigger.install.patch | 696 bytes | kristen pol |
Comments
Comment #1
kristen polI 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.
Comment #2
jwarner commentedSubscribing
Comment #3
westbywest commentedSubscribing. 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?
Comment #4
deekayen commented#294386: fields in drupal_trigger_assignments needs to be longer to support content types with long names
Comment #5
deekayen commentedComment #6
wickwood commentedsubscribing
Comment #8
gagarine commentedThe bug on the workflow project #460554: Actions disappearing: op field in drupal_trigger_assignement is to short