A key problem with UUID_Features, as it is right now, is that it only exports a specific subset of attributes of a given $node rather than processing the whole object. This is handled in uuid_node_features_export_render():
$node = node_get_by_uuid($uuid);
$export = new stdClass();
$props = array('uuid', 'type', 'language', 'status', 'comment', 'promote', 'moderate', 'sticky',
'title', 'body', 'format', 'name', 'path', 'revision');
foreach ($props as $key) {
if (isset($node->$key)) {
$export->$key = $node->$key;
}
}
As node_get_by_uuid() returns a full node object, it should instead use this object instead of looping over the limited number of known fields.
Comments
Comment #1
damienmckennaThis should get the ball rolling, it simply outputs the full $node object (minus nid, vid).
Comment #2
damienmckennaUpdated patch that takes a simpler approach - it copies the $node to the $export so the hooks don't have to change.
Comment #3
smoothify commentedThanks for working on this.
The second patch works well for me using webforms, will test with more types later.
Comment #4
alfthecat commentedHi,
I tried the patch and I can see there are a lot of extra variables now included in my feature.
However, when I run my feature in an install profile, te node id's specified in the feature's code are not respected and node/96 arrives as node/2 which breaks all my references and menu links.
Comment #5
chaps2 commented@AlfTheCat - answered here #968826: Export Menu links with UUID.
Comment #6
indytechcook commentedDo you really want to blindly accept all node attributes? Have you looked at the node object fully loaded? There is all sorts of temp/ugly junk in there.
The idea is that you control what parts of the node are exported/imported and how they are exported/imported by use of the hooks provided.
Comment #7
alfthecat commentedHi indytechcook,
Well, I think it's because of my specific use case. I basically tried to have an installation profile based on features, that not only pre-configures settings but also sets up guidance for the end user. So I required navigation, book outlines and promotion settings for my content.
I have recorded my efforts here: http://drupal.org/node/951406#comment-3707604
Little did I know I was opening pandora's box :) I do see what you are saying though, and I agree. And I now know the "ugly junk" is not the only hurdle associated.....
Comment #8
ezra-g commentedThe patch in #2 looks good and works great in my testing. Committed - Thanks!
http://drupal.org/cvs?commit=468634