Commit 9c14d87d authored by R.Muilwijk's avatar R.Muilwijk Committed by joseph.olstad

Issue #2882988 by R.Muilwijk: Add paragraphs support for translation in media browser

parent 9a608c39
...@@ -137,6 +137,11 @@ function media_field_widget_form(&$form, &$form_state, $field, $instance, $langc ...@@ -137,6 +137,11 @@ function media_field_widget_form(&$form, &$form_state, $field, $instance, $langc
} elseif ($element['#entity_type'] == 'field_collection_item' && !empty($form['#entity']) && property_exists($form['#entity'], 'language')) { } elseif ($element['#entity_type'] == 'field_collection_item' && !empty($form['#entity']) && property_exists($form['#entity'], 'language')) {
$element['#media_parent_entity_form_langcode'] = $form['#entity']->language; $element['#media_parent_entity_form_langcode'] = $form['#entity']->language;
} }
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;
}
// Add image field specific validators. // Add image field specific validators.
if ($field['type'] == 'image') { if ($field['type'] == 'image') {
......
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