When you output an object that contains text with line breaks, e.g. a node body using UUID_Features or a variable using StrongArm, the output gets indented. The problem is that when this in-code indented output gets compared against the in-database version CTools identifies there to be a difference between the two and says the output has been overridden.

Here's some example output from UUID_Features:

function myfeature_uuid_features_default_content() {
  $nodes = array();

  $nodes[] = array(
    'uuid' => '66e5b124-c6d1-11df-bc3b-8f580926a1b6',
    'type' => 'webform',
    'language' => '',
    'status' => '1',
    'comment' => '0',
    'promote' => '1',
    'moderate' => '0',
    'sticky' => '0',
    'title' => 'Contact Us',
    'body' => 'Phone: 555.555.5555
  Email: <a href="mailto:me@example.com">me@example.com</a>
  
  Or submit your comments or questions to us along with the information below:',
    'format' => '1',
    'name' => 'Damien',
    'path' => 'contact',
    'date' => '2010-09-21 16:55:56 -0500',
  );
  return $nodes;
}

The original node body text was:

Phone: 555.555.5555
Email: <a href="mailto:me@example.com">me@example.com</a>
  
Or submit your comments or questions to us along with the information below:

Because the version described in myfeature_uuid_features_default_content() has the three lines ("Email..", the blank line, "Or submit..") indented this node will report as being overridden.

Comments

damienmckenna’s picture

Project: Chaos Tool Suite (ctools) » Features
Version: 6.x-1.7 » 6.x-1.0
Component: Bulk Exporter » Code

Apologies, this turns out to be a bug in Features, which uses its own code to invoke the CTools exportables rather than rely upon CTools itself.

vinmassaro’s picture

subscribing

ezra-g’s picture

Subscribe - I'm seeing the same behavior as DamienMcKenna.

ryan_courtnage’s picture

subscribe, also seeing this.

pifantastic’s picture

Project: Features » UUID Features Integration
Version: 6.x-1.0 » 6.x-1.0-alpha1
Component: Code » uuid_node

Looks like this happens in UUID_Features 6.x-1.0-alpha1 in file uuid_node.features.inc line 86

<?php

    $code[] = '  $nodes[] = '. features_var_export($export, '  ') .';';

It's adding a two space prefix to the output. I'm going to roll a patch that removes that space.

pifantastic’s picture

Status: Active » Needs review
StatusFileSize
new30.62 KB

Not completely sure I created this patch correctly :P

pifantastic’s picture

Nope, I definitely didn't.

pifantastic’s picture

StatusFileSize
new1020 bytes

Here we go! This patch looks correct.

ezra-g’s picture

Status: Needs review » Fixed

This works well in my testing!

Committed - Heck yes -- thanks so much!

http://drupalcode.org/project/uuid_features.git/commit/b172429

ryan_courtnage’s picture

works for me. I wonder why the spaces were added in the first place though?

Status: Fixed » Closed (fixed)

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