op field in drupal_trigger_assignments needs to be longer to support content types with long names
| Project: | Drupal |
| Version: | 6.x-dev |
| Component: | trigger.module |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
I have a content-type whose name is 35 characters long. When trying to assign actions to this content-type via the Trigger page (admin/build/trigger/workflow/1, for example), I would get a message in green that said that the action had been added, when in fact the action had not been added, had no effect on anything, and did not show up under the Trigger listing for that action.
After poking around in the database I found that the value for op in the database table drupal_trigger_assignments was being truncated based on the fact that my content-type has a long name. I changed the length of the op field (from VARCAR 30 (i think that was the original value) to VARCAR 46), which was sufficient to fit the name of my content-type plus the prefixes and suffixes that Workflow adds, and voilà, everything worked afterwards.
But there's no doubt that the default length of this field should be changed to accomodate long content-type names. I would suggest VARCAR 255.

#1
In the 5.x-2.5 version of actions this column has already been increased to 40. But since noblends has even exceeded that limit, we should probably consider 64 or 128.
#2
Patch no longer applies.
#3
See also http://drupal.org/node/309919#comment-1021853 where this was fixed in actions 5.x.
#4
this expands it to 64
#5
humm... looks like the upgrade fails on MySQL: max key length is 1000 bytes
#6
See also #387852: trigger_assignments op column too small for workflow op data originally submitted to Workflow
#7
and #460554: Actions disappearing: op field in drupal_trigger_assignement is to short
#8
To #5 the max length is 46 for 1000 bytes
#9
Well, the op field should be going away anyway...since D7 no longer has ops.
http://drupal.org/node/525540
#10
Thanks for this infos jvandyk
So the patch for D6...
#11
I decided 128 was a reasonable limit to solve the issues I've been having with the workflow module. In order to fit this into MySQL's maximum key length limit, I had to drop the length of 'aid' to 173 characters (no, the maths doesn't seem to even remotely add up, but that's MySQL for you).