Commit 5401a8f9 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 25d50947
......@@ -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')) {
$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.
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