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
Comment #1
damienmckennaApologies, 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.
Comment #2
vinmassaro commentedsubscribing
Comment #3
ezra-g commentedSubscribe - I'm seeing the same behavior as DamienMcKenna.
Comment #4
ryan_courtnage commentedsubscribe, also seeing this.
Comment #5
pifantastic commentedLooks like this happens in UUID_Features 6.x-1.0-alpha1 in file uuid_node.features.inc line 86
It's adding a two space prefix to the output. I'm going to roll a patch that removes that space.
Comment #6
pifantastic commentedNot completely sure I created this patch correctly :P
Comment #7
pifantastic commentedNope, I definitely didn't.
Comment #8
pifantastic commentedHere we go! This patch looks correct.
Comment #9
ezra-g commentedThis works well in my testing!
Committed - Heck yes -- thanks so much!
http://drupalcode.org/project/uuid_features.git/commit/b172429
Comment #10
ryan_courtnage commentedworks for me. I wonder why the spaces were added in the first place though?