I am having a strange issue with Workflow 1.1 for Drupal 6. On only the Workflow tab of the Triggers page the Actions assigned to any state change disappear after they are assigned. I know they are still there because if I attempt to reassign the same action I get a duplicate entry warning. I have been using Workflow with Drupal 5 for some time without a problem but this issue will now allow me to use Workflow with Drupal 6 because I am unable to unassign or review what actions are associated with each workflow trigger.

Any assistance would be greatly appreciated.

Comments

kepford’s picture

I am having a similar problem. When I try to assign an action to a trigger in the Workflow tab the action is not displayed on the trigger/workflow page.

user warning: Duplicate entry 'workflow-workflow-articulation_agreement--9' for key 1 query: INSERT INTO trigger_assignments values ('workflow', 'workflow-articulation_agreement-17', '9', 1) in /var/www/articulation.statecenter.com/modules/trigger/trigger.admin.inc on line 206.

kepford’s picture

I have been working on this issue for a couple of days and I think I know why the Trigger assignments are not showing up on the trigger/workflow page. When I assign an action to a trigger it is not displayed on the page but it does go into the database table "trigger_assignments". After trying this on a clean install and using the page content type I noticed that "op" column has the following syntax "workflow-page-1", "workflow-page-2", and so on. When I went back to my dev site site I saw that my "trigger_assignments" table column "op" was missing the number. Here is what my fields looked like "workflow-articulation_agreement-". The trailing number is cut off. This also explains another problem I was having with the triggers. All of my workflow triggers were being performed at once irregardless to the workflow state transition.

So, it appears the issue is in the length of your machine-readable name for your content type. Hopefully this is an easy fix for the developer. In the mean time you can change the machine name of your content types.

jvandyk’s picture

gagarine’s picture

Title: Actions disappearing » Actions disappearing: op field in drupal_trigger_assignement is to short
gagarine’s picture

#2 "In the mean time you can change the machine name of your content types." I change the content type machine name but the old name is stile used..

gagarine’s picture

Component: User interface » Code

the interface work great and reflect the status of the DB...

thilohaas’s picture

the db column "op" is too short.
a short fix for actions on contenttypes with names shorter than ~40 characters could be:
execute this db statement on your drupal db:
/* 14:44:03 localhost */ ALTER TABLE `trigger_assignments` CHANGE `op` `op` varchar(46) NOT NULL DEFAULT '';

there should be a better way to do that, maybe split the content type and trigger action id in the db?

cheers

JaapB’s picture

subscribing...

gravelpot’s picture

Subscribing

Bastlynn’s picture

Version: 6.x-1.1 » 7.x-1.x-dev

Even with the move to use hooks in D7 for triggers, the length remains an issue (and may in fact just get worse with time). Truthfully - the field in triggers should be longer, but that's a change to get put into triggers, and may or may not take too long to get committed. In the meantime we can add something here with Workflow 7 (and backport to 6) to help people avoid hitting this error all the time.