diff --git a/core/includes/common.inc b/core/includes/common.inc index 188934b..ec88c45 100644 --- a/core/includes/common.inc +++ b/core/includes/common.inc @@ -3136,7 +3136,12 @@ function drupal_render(&$elements, $is_recursive_call = FALSE) { '#suffix', ); foreach ($markup_keys as $key) { - $elements[$key] = isset($elements[$key]) ? Xss::filterAdmin($elements[$key]) : NULL; + if (!empty($elements[$key]) && !is_array($elements[$key])) { + $elements[$key] = Xss::filterAdmin($elements[$key]); + } + else { + $elements[$key] = NULL; + } } // Assume that if #theme is set it represents an implemented hook. diff --git a/core/modules/locale/src/Form/ImportForm.php b/core/modules/locale/src/Form/ImportForm.php index 426187f..75dda76 100644 --- a/core/modules/locale/src/Form/ImportForm.php +++ b/core/modules/locale/src/Form/ImportForm.php @@ -103,18 +103,22 @@ public function buildForm(array $form, FormStateInterface $form_state) { 'file_validate_extensions' => array('po'), 'file_validate_size' => array(file_upload_max_size()), ); + + $file_description = array( + '#theme' => 'file_upload_help', + '#description' => $this->t('A Gettext Portable Object file.'), + '#upload_validators' => $validators, + ); + $form['file'] = array( '#type' => 'file', '#title' => $this->t('Translation file'), - '#description' => array( - '#theme' => 'file_upload_help', - '#description' => $this->t('A Gettext Portable Object file.'), - '#upload_validators' => $validators, - ), + '#description' => drupal_render($file_description), '#size' => 50, '#upload_validators' => $validators, '#attributes' => array('class' => array('file-import-input')), ); + $form['langcode'] = array( '#type' => 'select', '#title' => $this->t('Language'),