In the function nodereference_uuid_node_features_export_render_alter
when you do
<?php
$export->$field_name = array();
you are actually overriding $node->$field_name, and the original $node->field_name values are lost and not exported.
A drupal_clone must be done before calling the hook.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | 1060300-features_uuid-nodereferences_are_not_preserved-02.patch | 2.55 KB | smokris |
| #6 | 1060300-features_uuid-nodereferences_are_not_preserved.patch | 2.86 KB | netw3rker |
| #1 | drupal-clone-alter-01.patch | 919 bytes | Pedro Lozano |
| drupal-clone-alter.patch | 807 bytes | Pedro Lozano |
Comments
Comment #1
Pedro Lozano commentedFixed to avoid php errors.
Comment #2
Pedro Lozano commentedComment #3
Pedro Lozano commentedComment #4
phayes commented[Deleted] -- nevermind...
Comment #5
mikehostetler commentedConfirmed that this patch fixes the node reference issue.
Additionally, in my testing, when the feature containing the node with the reference is imported into a new site, the reference is not properly recreated the first time the feature is turned on. I had to turn on the feature, revert it, then revert it again. From there, it worked correctly.
Comment #6
netw3rker commentedConfirmed, the above patch does fix node references. The only problem is it also includes the referenced node regardless of whether it is already included in another feature, thereby creating conflicts between features.
the patch below does improves upon the patch in #1 by checking the dependency tree for the node being referenced, and if it is already packaged into a feature, a dependency is added to that feature instead of the node. if the node is not already in a feature, it gets added to the feature for packaging.
hope this helps!
-Chris
Comment #7
smokris@netw3rker's patch in #6 works for me, too — solves the OP's problem, and properly handles nodes already claimed in another Feature.
Re-rolled, in -p1 patch format.