it uses node_load/save directly, this means other uuid integration module couldn't modify the uuid references inside the node, for example file uuid in body from media module.

I don't know if there's a reason it is coded this way, but I tried the following change which seem to fix this:

@@ -67,10 +67,11 @@
       continue;
     }
     // Attempt to load the node, using a fresh cache.
-    $node = node_load($nid, NULL, TRUE);
-    if (empty($node)) {
+    $nodes = entity_uuid_load('node', array($uuid), array(), TRUE);
+    if (!count($nodes)) {
       continue;
     }
+    $node = reset($nodes);
     if (!empty($node->path)) {
       $node->pathauto_perform_alias = FALSE;
     }
@@ -138,7 +139,7 @@
 
       $node = node_submit($node);
       uuid_features_file_field_import($node, 'node');
-      node_save($node);
+      entity_uuid_save('node', $node);
     }
   }
 }

Comments

jrao’s picture

Issue summary: View changes

Change code block

joseph.olstad’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new883 bytes

Thanks jrao, this still seems to be the case.

Created a patch from above code.

Anyone else have comments?

msmithcti’s picture

Status: Needs review » Needs work

Loading the node using entity_uuid_load() actually causes issues as later code (e.g. the field collection render alter) is expecting a node object without UUIDs.

jrao’s picture

the field collection render alter

Sorry, not sure what this means?

torotil’s picture

Status: Needs work » Needs review
StatusFileSize
new788 bytes

What about using entity_make_entity_universal() instead?

socialnicheguru’s picture

no longer applies to the latest dev

Status: Needs review » Needs work

The last submitted patch, 4: 2117453-uuid_features-use-entity_uuid_save-4.patch, failed testing.

torotil’s picture

StatusFileSize
new890 bytes

Reroll for 7.x-1.x.

torotil’s picture

Status: Needs work » Needs review
das-peter’s picture

Status: Needs review » Fixed

Looks good to me. Committed.
Thanks all!

  • das-peter committed 7b2aecf on 7.x-1.x authored by torotil
    Issue #2117453 by torotil, joseph.olstad | jrao: Fixed uuid_node doesn't...

  • das-peter committed cb04a0e on 7.x-1.x
    Issue #2117453: Adtermath - fixing the call signature to...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.