Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Need to add node_clone integration to prevent duplicating the uuid.
Comment | File | Size | Author |
---|---|---|---|
#20 | 1868302-6.x-20.patch | 1004 bytes | pwolanin |
#18 | 1868302-18.patch | 556 bytes | pwolanin |
#13 | node_clone-uuid_support-1868302-13.patch | 1.27 KB | sebas5384 |
#12 | dont-clone-uuids-1868302-12.patch | 1.02 KB | mixxmac |
#9 | uuid-node-clone-compat-1868302.patch | 505 bytes | ethanethan |
Comments
Comment #1
chrisivens CreditAttribution: 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 CreditAttribution: chrisivens commentedComment #3
mixxmac CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: mixxmac commentedOk... will do. I'll try testing this again later today, and let you know if it works.
Comment #8
mixxmac CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: gcassie commentedWorks well for me.
Comment #15
Maxime Gilbert CreditAttribution: Maxime Gilbert commentedWorks well with Node export and Features.
Must be added to the next release candidate.
Comment #16
pwolanin CreditAttribution: pwolanin commentedWhy is the module_exists() needed?
Comment #17
pwolanin CreditAttribution: pwolanin commentedneeds re-roll for refactoring in [#1316284 ]
Comment #18
pwolanin CreditAttribution: pwolanin commentedthis simple?
Comment #19
pwolanin CreditAttribution: pwolanin commentedcommitted #18
Comment #20
pwolanin CreditAttribution: pwolanin commentedComment #22
ccb621 CreditAttribution: 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 CreditAttribution: pwolanin as a volunteer and at SciShield commentedoops, yeah - just failed to mark it fixed