Commit 0a94b927 authored by joseph.olstad's avatar joseph.olstad Committed by olstjos

Issue #2885024 by joseph.olstad, marthasa: Notice: Undefined property:...

Issue #2885024 by joseph.olstad, marthasa: Notice: Undefined property: ParagraphsItemEntity::$language in media_field_widget_form() (
parent 1f96f2fc
......@@ -140,8 +140,10 @@ function media_field_widget_form(&$form, &$form_state, $field, $instance, $langc
}
else if ($element['#entity_type'] == 'paragraphs_item' && !empty($form['#entity'])) {
$host = $element['#entity']->hostEntity();
$element['#media_parent_entity_form_langcode'] = $host->language;
$element['#media_parent_entity_source_langcode'] = $host->language;
if (isset($host->$language)) {
$element['#media_parent_entity_form_langcode'] = $host->language;
$element['#media_parent_entity_source_langcode'] = $host->language;
}
}
// Add image field specific validators.
......
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