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.

Comments

pavel.karoukin’s picture

Status: Active » Needs review
StatusFileSize
new320 bytes

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

wizonesolutions’s picture

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

wizonesolutions’s picture

StatusFileSize
new586 bytes

Here's a re-roll of this patch against the Aug 8 Dev version. Hopefully this helps it get committed...

gdd’s picture

I'm not really enthusiastic about committing patches to support every contrib module out there. Did you test this at all yet?

wizonesolutions’s picture

Status: Needs review » Needs work

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

gdd’s picture

Category: bug » feature

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

wizonesolutions’s picture

Status: Needs work » Postponed

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

wizonesolutions’s picture

StatusFileSize
new546 bytes

Hey, 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.

Renee S’s picture

Thanks for this, @wizonesolutions!