After having installed the deployment module, I sometimes get the following error when I create a new node:
"user warning: Duplicate entry '5874721404b43bf6cc949a8.84973285' for key 2 query: INSERT INTO node_uuid (nid, uuid) VALUES (83388, '5874721404b43bf6cc949a8.84973285') in /home/XXXXXXXX/ XXXXXXXX/sites/all/modules/deploy/modules/deploy_uuid/deploy_uuid.module on line 289.".
This mostly happens when I do one of the following:
- I am logged in as "admin", but when I create the node, I publish it as another user (I write another user in the "Authored by"-field of the "node create"-form.
- I clone a node using the "Clone module". The title of the cloned node ist the same as of the original node. Of course pathauto creates another url for it (adds an "-1" for example). A use case for this scenario would be an event that happens several times. One node represents a single date when the event takes place.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | deploy_uuid_675238_node_clone_3.patch | 546 bytes | wizonesolutions |
| #3 | deploy_uuid_675238_node_clone_2.patch | 586 bytes | wizonesolutions |
| #1 | deploy_uuid_node_clone.patch | 320 bytes | pavel.karoukin |
Comments
Comment #1
pavel.karoukin commentedThis happened to me too. The problem - when you clone node, $node->uuid field is not erased and new is not generated.
Patch to fix this attached.
Comment #2
wizonesolutionsWondering if this patch was ever committed or if it is on the radar for it.
Does it need more testing? If so I can post my feedback after applying it.
Comment #3
wizonesolutionsHere's a re-roll of this patch against the Aug 8 Dev version. Hopefully this helps it get committed...
Comment #4
gddI'm not really enthusiastic about committing patches to support every contrib module out there. Did you test this at all yet?
Comment #5
wizonesolutionsTotally understand.
What do you suggest then? Should I take it up with Node Clone? And in testing...seems like it failed. I still get the error every second time. Setting to needs work.
Let me know though how you think it's best to tackle this...
Comment #6
gddWell I'm not sure pwolanin is going to be any more eager to specifically support deploy than i am to support node clone. Your best bet is probably to add that code to a clone_node_alter function in your own custom module. I don't have enough experience with node_clone() to know if the code above is good or not.
Comment #7
wizonesolutionsFair enough. I set to postponed so people will find this in active issues. If anyone reads this in the future and thinks I should release an actual Drupal module with this feature (maybe Deploy Extras or something), let me know. Otherwise, I won't bother.
One thing I have seen some other modules, like ajax, do though is have a contrib/ folder where third-party module support can be enabled optionally. Not sure if you would be open to a patch introducing that? Or if you think it's out of scope entirely. Not sure how much further I'll even pursue things but let me know just in case...
Comment #8
wizonesolutionsHey, I just tested this and got it working...for what it's worth. I had to
a. upgrade to the latest node_clone
b. make it reset $node->uuid to NULL regardless of if it's in prepopulate or save-edit mode.
Patch is attached.
Comment #9
Renee S commentedThanks for this, @wizonesolutions!