Commit 5da05c0f authored by Daniel Korte's avatar Daniel Korte Committed by olstjos

Issue #2831873 by Daniel Korte: FieldColelctItemEntity::$language undefined in...

Issue #2831873 by Daniel Korte: FieldColelctItemEntity::$language undefined in media_field_widget_form()
parent dfd19688
......@@ -134,7 +134,7 @@ function media_field_widget_form(&$form, &$form_state, $field, $instance, $langc
elseif (module_exists('translation') && $element['#entity_type'] == 'node' && translation_supported_type($element['#entity']->type)) {
$element['#media_parent_entity_form_langcode'] = $element['#entity']->language;
$element['#media_parent_entity_source_langcode'] = $element['#entity']->language;
} elseif ($element['#entity_type'] == 'field_collection_item') {
} elseif ($element['#entity_type'] == 'field_collection_item' && property_exists($form['#entity'], 'language')) {
$element['#media_parent_entity_form_langcode'] = $form['#entity']->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