Commit 01e0a57e authored by carstenG's avatar carstenG Committed by Ra Mänd
Browse files

Issue #2542814 by carstenG, Chris Matthews: Devel generate doesn't work when...

Issue #2542814 by carstenG, Chris Matthews: Devel generate doesn't work when field_collection Widget is hidden
parent 4fe95e00
......@@ -1914,6 +1914,15 @@ function field_collection_field_property_set($entity, $name, $value, $langcode,
* Implements hook_devel_generate().
*/
function field_collection_devel_generate($object, $field, $instance, $bundle) {
if (field_behaviors_widget('multiple values', $instance) == FIELD_BEHAVIOR_CUSTOM) {
return devel_generate_multiple('_field_collection_devel_generate', $object, $field, $instance, $bundle);
}
else {
return _field_collection_devel_generate($object, $field, $instance, $bundle);
}
}
function _field_collection_devel_generate($object, $field, $instance, $bundle) {
// Create a new field collection object and add fake data to its fields.
$field_collection = entity_create('field_collection_item', array('field_name' => $field['field_name']));
$field_collection->language = $object->language;
......
Markdown is supported
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