When importing an exported node with attached display (export_display) importation will not be complete since import callback will eval on $code_string and export_display php code will be truncated. So no panels display data will be imported.
Example:
exported code as export_display attribute as the following:
'node_export_drupal_version' => '7',
'export_display' => "$display = new panels_display();\n$display->layout = 'flexible:...
during node_export_drupal_import($code_string) execution nodes array will be obtained by calling eval on above:
$nodes = eval('return ' . $code_string . ';');
and export_display will now be:
'node_export_drupal_version' => '7',
'export_display' => " = new panels_display(); = 'flexible:...
escaping the $code_string seems to work, but seems more an ugly hack than a solution:
$code_string = str_replace('$', '\$', $code_string);
Comments
Comment #1
danielb CreditAttribution: danielb commentedComment #2
fizk CreditAttribution: fizk commentedI ran into this issue as well, although I'm using Javascript instead of PHP in
$code_string
.My workaround was to implement
hook_node_export_decode_alter()
: