Commit 92a68e37 authored by drothstein's avatar drothstein Committed by Tim Plunkett
Browse files

Issue #1269750 by bradjones1, ygerasimov, pwaterz, danmuzyka, mr.york,...

Issue #1269750 by bradjones1, ygerasimov, pwaterz, danmuzyka, mr.york, David_Rothstein, marvil07, eroepken | mErilainen: Fixed Exporting a Field Collection field with a default value to Features leads to a PHP parse error.
parent 96eff7c2
......@@ -364,6 +364,23 @@ class FieldCollectionItemEntity extends Entity {
}
}
/**
* Export the field collection item.
*
* Since field collection entities are not directly exportable (i.e., do not
* have 'exportable' set to TRUE in hook_entity_info()) and since Features
* calls this method when exporting the field collection as a field attached
* to another entity, we return the export in the format expected by
* Features, rather than in the normal Entity::export() format.
*/
public function export($prefix = '') {
// Based on code in EntityDefaultFeaturesController::export_render().
$export = "entity_import('" . $this->entityType() . "', '";
$export .= addcslashes(parent::export(), '\\\'');
$export .= "')";
return $export;
}
/**
* Magic method to only serialize what's necessary.
*/
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment