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

damienmckenna’s picture

Status: Active » Needs review
StatusFileSize
new1.62 KB

This should get the ball rolling, it simply outputs the full $node object (minus nid, vid).

damienmckenna’s picture

StatusFileSize
new1.34 KB

Updated patch that takes a simpler approach - it copies the $node to the $export so the hooks don't have to change.

smoothify’s picture

Thanks for working on this.

The second patch works well for me using webforms, will test with more types later.

alfthecat’s picture

Hi,

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.

chaps2’s picture

@AlfTheCat - answered here #968826: Export Menu links with UUID.

indytechcook’s picture

Do 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.

alfthecat’s picture

Hi 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.....

ezra-g’s picture

Status: Needs review » Fixed

The patch in #2 looks good and works great in my testing. Committed - Thanks!

http://drupal.org/cvs?commit=468634

Status: Fixed » Closed (fixed)

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