user warning: Duplicate entry '0' for key 1 query: INSERT INTO workflow_node (nid, sid, uid, stamp) VALUES (0, 15, 0, 1263934407) in /var/www/drupal/sites/all/modules/workflow.module on line 1335.

Or similar, pops up everytime I create new content after upgrading from 1.1 to 1.3. Is there a work around, or perhaps was this issue resolved by other means? (perhaps reinstallation or re-update the module?). I am currently back at 6.x-1.1, but wish to have this upgraded due to the Security Patch.

Thanks,
Jason Cameron

Comments

cameronjb’s picture

Has anyone else had this error or have any pointers in stopping this?

Thanks!

cameronjb’s picture

Status: Active » Closed (fixed)

Nevermind, happened to be a problem with the workflow actions/triggers.

talalus’s picture

I have same issue ! how did you fix it ?

talalus’s picture

Nevermind, problem with triggers.

mutuku’s picture

Category: bug » support
Status: Closed (fixed) » Active

Same issue...How did you fix the problem with triggers??

javier1968’s picture

Same problem here, how did you fix it?

Cheers

javier1968’s picture

Anyone Please?

Cheers

Encarte’s picture

Version: 6.x-1.3 » 6.x-1.5
Issue tags: +triggers

This error cames up when using Rules action Change workflow state to new state.

Encarte’s picture

Category: support » bug

No matter what configuration of triggers is used, no error should come up just by the use of triggers or rules module. I think this is not a support request, but a bug.

ifoundthetao’s picture

I agree that this is a bug. The thing that I'm seeing is that the nid isn't being taken... it's trying to insert '0', but the nid (node id) is definitely not that! Let's do some digging to find out where they're getting these variables from. It could be something as simple as some mixed up logic in a not often used area.

EDIT: After some digging around, I've found that the NID isn't being passed in a few different functions. When I'm trying to transition the state of this NID (on my site where I'm experiencing this), it's a state transition from a freshly created node.

For instance, when a user is created, then a page is created, and when the page is created the state is changed and a default taxonomy term is added.

So, I think there's something happening in the beginning. I need to check to see if the "save" is what is triggering or if the "creation" is what is triggering. I haven't worked with Drupal or WorkFlow in a long time, so I apologize for being rusty.

ifoundthetao’s picture

Okay... here's the scoop.. You need to explicitly set a "save a content" action to get rid of this puppy! I had to do two of them to ensure that what I was doing was done properly. This way other rules weren't called before the content was saved!

This will HOPEFULLY clear it up for everyone.

Also, if your workflow access is jacked, make sure that you're working with PUBLISHED content, as if you aren't, the access control won't do anything. ;P

ericbroder’s picture

Thanks for the tip ifoundthetao. I was able to solve this problem by adding the "Save a content" action to my rule and also adjusting the action weights to get the correct order. This is what worked for me:

- Add "Save a content" action to rule, with "Force immediate saving" option turned on, and give it the second-to-last weight (9).
- Move "Change workflow state of content to new state" action to final weight (10).

Bastlynn’s picture

Status: Active » Closed (works as designed)

Glad to know this got taken care of. It looks to be all a configuration issue - just taking into account the flow of logic in Rules so I'm going to go ahead and close the ticket out. It'll still pop up on searches so someone else with a simular problem will be able to find it.

ericbroder’s picture

I'll add some more details in case it helps others. For me, the problem was that my rule was supposed to create new nodes after ubercart checkouts and set them to "active" workflow state, but instead the workflow state was blank / empty / NULL. And then for Views that were supposed to query based on workflow state, it was difficult to filter on these blank / empty workflow state nodes, even if I said state != cancelled state.