op field in drupal_trigger_assignments needs to be longer to support content types with long names

noblends - August 12, 2008 - 16:33
Project:Drupal
Version:6.x-dev
Component:trigger.module
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review
Description

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

jvandyk - August 18, 2008 - 03:43
Project:Workflow» Drupal
Version:6.x-1.x-dev» 7.x-dev
Component:Code» trigger.module

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.

AttachmentSizeStatusTest resultOperations
oplengthjv.patch656 bytesIdleUnable to apply patch oplengthjv.patchView details | Re-test

#2

lilou - September 9, 2008 - 22:36
Status:active» needs work

Patch no longer applies.

#3

jvandyk - December 29, 2008 - 20:36

See also http://drupal.org/node/309919#comment-1021853 where this was fixed in actions 5.x.

#4

drewish - April 23, 2009 - 17:56
Status:needs work» needs review

this expands it to 64

AttachmentSizeStatusTest resultOperations
trigger_294386.patch882 bytesIdleInvalid PHP syntax in trigger.install.View details | Re-test

#5

drewish - April 23, 2009 - 18:02
Status:needs review» needs work

humm... looks like the upgrade fails on MySQL: max key length is 1000 bytes

#6

deekayen - June 5, 2009 - 20:47

#8

gagarine - September 16, 2009 - 15:13

To #5 the max length is 46 for 1000 bytes

#9

jvandyk - September 16, 2009 - 23:48

Well, the op field should be going away anyway...since D7 no longer has ops.

http://drupal.org/node/525540

#10

gagarine - September 17, 2009 - 08:30
Version:7.x-dev» 6.x-dev
Status:needs work» needs review

Thanks for this infos jvandyk

So the patch for D6...

AttachmentSizeStatusTest resultOperations
trigger_op.patch825 bytesIgnoredNoneNone

#11

jlaver - December 16, 2009 - 11:28

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).

 
 

Drupal is a registered trademark of Dries Buytaert.