Closed (fixed)
Project:
Node clone
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Dec 2012 at 10:02 UTC
Updated:
4 Nov 2016 at 00:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
chrisivens commentedTHis patch may or may not add the hook_clone_node_alter() function in the right place but it should prevent the uuid being duplicated with node_clone.
Comment #2
chrisivens commentedComment #3
mixxmac commentedThanks for adding this patch. I just tested it, and it looks like it does the trick for the uuid field.
It looks like the revision ids and comments are being cloned too though. So, I tried editing your patch to see if the same would work for those fields...
I think
$node->log = '';works to prevent the revision comments from being cloned. But,$node->vid = '';didn't seem to do anything to prevent vuuids from being cloned. So, I think there is still a problem with the revision VUUID being cloned.The attached image shows the results I was getting when I tested this.
Thanks for adding the patch. If we can fix the vuuid part, then I think that would solve this issue.
Comment #4
chrisivens commentedI don't know for certain but something could maybe be done with these bits:
By setting the vuuid to null it should regenerate in uuid_entity_presave()
Comment #5
mixxmac commentedThanks Chris. It looks like I made a mistake and used "vid" instead of "vuuid". Maybe that's all it needs. I'll try testing this again soon, and hopefully that will fix it.
Comment #6
chrisivens commentedIf you do get it to work, please let me know. I'd love to get this fixed ready for a deploy I need to do imminently.
Comment #7
mixxmac commentedOk... will do. I'll try testing this again later today, and let you know if it works.
Comment #8
mixxmac commentedI tested the patch with the extra two lines of code that I added. It worked, so this seems to be the fix that is needed in uuid.core.inc.
I don't have a patch for this, but this is the code to fix the problem:
Comment #9
ethanethan commentedThe change in #8 solves the issue for us, including in translation and revision (ERS) test cases.
I made a patch from #8 and will try to trigger the automated tests again...
Comment #10
ethanethan commentedAre these tests being postponed because theres something wrong with the patch? Maybe we need a dependency on node_clone somewhere.
Comment #11
skwashd commentednode_clone isn't not part of core, it is a contrib module. This needs to be fixed in the node_clone module. It doesn't introduce a hard dependency on UUID, so there is nothing stopping the fix landing there.
Comment #12
mixxmac commentedI made a patch for setting uuid, vuuid, and log to NULL in clone_node_prepopulate() and clone_node_save(). I'm not sure if this is necessary anymore for the vuuid and log (node_revisions), because I didn't notice a problem with them when I tested it this time.
Seems to work for me, but please test to confirm. Thanks.
Comment #13
sebas5384 commentedI reviewed the patch and worked like a charm!
This problem was really messing things up when using UUID, and with others modules like Services UUID.
I just add a simple module_exists() to check if the UUID is enabled to the patch of @mixxmac in #12.
Cheers!
Comment #14
gcassie commentedWorks well for me.
Comment #15
Maxime Gilbert commentedWorks well with Node export and Features.
Must be added to the next release candidate.
Comment #16
pwolanin commentedWhy is the module_exists() needed?
Comment #17
pwolanin commentedneeds re-roll for refactoring in [#1316284 ]
Comment #18
pwolanin commentedthis simple?
Comment #19
pwolanin commentedcommitted #18
Comment #20
pwolanin commentedComment #22
ccb621 commentedWhat stopped/is stopping this from being merged?Never mind. I see this was merged to the 7.x and 8.x branches.
Comment #23
pwolanin commentedoops, yeah - just failed to mark it fixed