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
Comment #0.0
jrao commentedChange code block
Comment #1
joseph.olstadThanks jrao, this still seems to be the case.
Created a patch from above code.
Anyone else have comments?
Comment #2
msmithcti commentedLoading 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.
Comment #3
jrao commentedSorry, not sure what this means?
Comment #4
torotil commentedWhat about using entity_make_entity_universal() instead?
Comment #5
socialnicheguru commentedno longer applies to the latest dev
Comment #8
torotil commentedReroll for 7.x-1.x.
Comment #9
torotil commentedComment #10
das-peter commentedLooks good to me. Committed.
Thanks all!