Closed (works as designed)
Project:
Workflow
Version:
6.x-1.5
Component:
Miscellaneous
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
26 Jan 2010 at 15:37 UTC
Updated:
5 Jan 2012 at 22:24 UTC
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
Comment #1
cameronjb commentedHas anyone else had this error or have any pointers in stopping this?
Thanks!
Comment #2
cameronjb commentedNevermind, happened to be a problem with the workflow actions/triggers.
Comment #3
talalus commentedI have same issue ! how did you fix it ?
Comment #4
talalus commentedNevermind, problem with triggers.
Comment #5
mutuku commentedSame issue...How did you fix the problem with triggers??
Comment #6
javier1968 commentedSame problem here, how did you fix it?
Cheers
Comment #7
javier1968 commentedAnyone Please?
Cheers
Comment #8
Encarte commentedThis error cames up when using Rules action Change workflow state to new state.
Comment #9
Encarte commentedNo 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.
Comment #10
ifoundthetao commentedI 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.
Comment #11
ifoundthetao commentedOkay... 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
Comment #12
ericbroder commentedThanks 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).
Comment #13
Bastlynn commentedGlad 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.
Comment #14
ericbroder commentedI'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.