summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrmuilwijk2017-06-03 02:20:36 (GMT)
committerolstjos2017-06-03 02:20:36 (GMT)
commit9c14d87d30bbf27d4c8af5889c596d5d486ddb29 (patch)
tree2371cadb2aead919006135775069058dfc42b689
parent9a608c3966a8933045cb796c62abd84998e13aa3 (diff)
Issue #2882988 by R.Muilwijk: Add paragraphs support for translation in media browser
-rw-r--r--includes/media.fields.inc5
1 files changed, 5 insertions, 0 deletions
diff --git a/includes/media.fields.inc b/includes/media.fields.inc
index 96968c9..65e0e74 100644
--- a/includes/media.fields.inc
+++ b/includes/media.fields.inc
@@ -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') {