diff --git a/core/lib/Drupal/Component/Utility/Html.php b/core/lib/Drupal/Component/Utility/Html.php index a775cdb..a88555d 100644 --- a/core/lib/Drupal/Component/Utility/Html.php +++ b/core/lib/Drupal/Component/Utility/Html.php @@ -54,10 +54,10 @@ class Html { * The cleaned class name. */ public static function getClass($class) { - if (!isset(static::$classes[$class])) { - static::$classes[$class] = static::cleanCssIdentifier(Unicode::strtolower($class)); + if (!isset(static::$classes[(string) $class])) { + static::$classes[(string) $class] = static::cleanCssIdentifier(Unicode::strtolower($class)); } - return static::$classes[$class]; + return static::$classes[(string) $class]; } /** diff --git a/core/lib/Drupal/Core/Entity/EntityManager.php b/core/lib/Drupal/Core/Entity/EntityManager.php index 351361f..80f6fd3 100644 --- a/core/lib/Drupal/Core/Entity/EntityManager.php +++ b/core/lib/Drupal/Core/Entity/EntityManager.php @@ -945,7 +945,7 @@ public function getEntityTypeLabels($group = FALSE) { foreach ($definitions as $entity_type_id => $definition) { if ($group) { - $options[$definition->getGroupLabel()][$entity_type_id] = $definition->getLabel(); + $options[(string) $definition->getGroupLabel()][$entity_type_id] = $definition->getLabel(); } else { $options[$entity_type_id] = $definition->getLabel(); @@ -959,7 +959,7 @@ public function getEntityTypeLabels($group = FALSE) { } // Make sure that the 'Content' group is situated at the top. - $content = $this->t('Content', array(), array('context' => 'Entity type group')); + $content = (string) $this->t('Content', array(), array('context' => 'Entity type group')); $options = array($content => $options[$content]) + $options; } diff --git a/core/modules/ckeditor/ckeditor.admin.inc b/core/modules/ckeditor/ckeditor.admin.inc index 21be21d..6c42d72 100644 --- a/core/modules/ckeditor/ckeditor.admin.inc +++ b/core/modules/ckeditor/ckeditor.admin.inc @@ -113,6 +113,8 @@ function template_preprocess_ckeditor_settings_toolbar(&$variables) { $variables['active_buttons'] = array(); foreach ($active_buttons as $row_number => $button_row) { foreach ($button_groups[$row_number] as $group_name) { + // @todo fix this + $group_name = (string) $group_name; $variables['active_buttons'][$row_number][$group_name] = array( 'group_name_class' => Html::getClass($group_name), 'buttons' => array(), diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index 20ba4a3..afb7c7d 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -299,7 +299,7 @@ function comment_form_field_ui_field_storage_add_form_alter(&$form, FormStateInt } if (!_comment_entity_uses_integer_id($form_state->get('entity_type_id'))) { // You cannot use comment fields on entity types with non-integer IDs. - unset($form['add']['new_storage_type']['#options'][t('General')]['comment']); + unset($form['add']['new_storage_type']['#options']['general']['comment']); } } diff --git a/core/modules/entity_reference/entity_reference.module b/core/modules/entity_reference/entity_reference.module index e206dee..fbd9081 100644 --- a/core/modules/entity_reference/entity_reference.module +++ b/core/modules/entity_reference/entity_reference.module @@ -128,8 +128,8 @@ function entity_reference_field_config_presave(FieldConfigInterface $field) { function entity_reference_form_field_ui_field_storage_add_form_alter(array &$form) { // Move the "Entity reference" option to the end of the list and rename it to // "Other". - unset($form['add']['new_storage_type']['#options'][t('Reference')]['entity_reference']); - $form['add']['new_storage_type']['#options'][t('Reference')]['entity_reference'] = t('Other…'); + unset($form['add']['new_storage_type']['#options']['reference']['entity_reference']); + $form['add']['new_storage_type']['#options']['reference']['entity_reference'] = t('Other…'); } /** diff --git a/core/modules/language/src/Form/NegotiationBrowserForm.php b/core/modules/language/src/Form/NegotiationBrowserForm.php index bf0ce4e..5fa186a 100644 --- a/core/modules/language/src/Form/NegotiationBrowserForm.php +++ b/core/modules/language/src/Form/NegotiationBrowserForm.php @@ -82,8 +82,8 @@ public function buildForm(array $form, FormStateInterface $form_state) { } else { $language_options = array( - $this->t('Existing languages') => $existing_languages, - $this->t('Languages not yet added') => $this->languageManager->getStandardLanguageListWithoutConfigured(), + (string) $this->t('Existing languages') => $existing_languages, + (string) $this->t('Languages not yet added') => $this->languageManager->getStandardLanguageListWithoutConfigured(), ); } diff --git a/core/modules/locale/src/Form/ImportForm.php b/core/modules/locale/src/Form/ImportForm.php index 1728879..f3007f6 100644 --- a/core/modules/locale/src/Form/ImportForm.php +++ b/core/modules/locale/src/Form/ImportForm.php @@ -94,8 +94,8 @@ public function buildForm(array $form, FormStateInterface $form_state) { else { $default = key($existing_languages); $language_options = array( - $this->t('Existing languages') => $existing_languages, - $this->t('Languages not yet added') => $this->languageManager->getStandardLanguageListWithoutConfigured(), + (string) $this->t('Existing languages') => $existing_languages, + (string) $this->t('Languages not yet added') => $this->languageManager->getStandardLanguageListWithoutConfigured(), ); } diff --git a/core/modules/views/src/Plugin/views/area/TokenizeAreaPluginBase.php b/core/modules/views/src/Plugin/views/area/TokenizeAreaPluginBase.php index 82bb51d..8e8c719 100644 --- a/core/modules/views/src/Plugin/views/area/TokenizeAreaPluginBase.php +++ b/core/modules/views/src/Plugin/views/area/TokenizeAreaPluginBase.php @@ -53,13 +53,13 @@ public function tokenForm(&$form, FormStateInterface $form_state) { // Get a list of the available fields and arguments for token replacement. $options = array(); foreach ($this->view->display_handler->getHandlers('field') as $field => $handler) { - $options[t('Fields')]["[$field]"] = $handler->adminLabel(); + $options['fields']["[$field]"] = $handler->adminLabel(); } $count = 0; // This lets us prepare the key as we want it printed. foreach ($this->view->display_handler->getHandlers('argument') as $handler) { - $options[t('Arguments')]['%' . ++$count] = $this->t('@argument title', array('@argument' => $handler->adminLabel())); - $options[t('Arguments')]['!' . $count] = $this->t('@argument input', array('@argument' => $handler->adminLabel())); + $options['arguments']['%' . ++$count] = $this->t('@argument title', array('@argument' => $handler->adminLabel())); + $options['arguments']['!' . $count] = $this->t('@argument input', array('@argument' => $handler->adminLabel())); } if (!empty($options)) { diff --git a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php index f9ae57a..0624fc5 100644 --- a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php +++ b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php @@ -1728,8 +1728,8 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { $options = array(); $count = 0; // This lets us prepare the key as we want it printed. foreach ($this->view->display_handler->getHandlers('argument') as $handler) { - $options[t('Arguments')]['%' . ++$count] = $this->t('@argument title', array('@argument' => $handler->adminLabel())); - $options[t('Arguments')]['!' . $count] = $this->t('@argument input', array('@argument' => $handler->adminLabel())); + $options[(string) t('Arguments')]['%' . ++$count] = $this->t('@argument title', array('@argument' => $handler->adminLabel())); + $options[(string) t('Arguments')]['!' . $count] = $this->t('@argument input', array('@argument' => $handler->adminLabel())); } // Default text. diff --git a/core/modules/views/src/Plugin/views/field/FieldPluginBase.php b/core/modules/views/src/Plugin/views/field/FieldPluginBase.php index 152d4e9..455c95f 100644 --- a/core/modules/views/src/Plugin/views/field/FieldPluginBase.php +++ b/core/modules/views/src/Plugin/views/field/FieldPluginBase.php @@ -863,18 +863,18 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { // Setup the tokens for fields. $previous = $this->getPreviousFieldLabels(); foreach ($previous as $id => $label) { - $options[t('Fields')]["{{ $id }}"] = substr(strrchr($label, ":"), 2 ); + $options['fields']["{{ $id }}"] = substr(strrchr($label, ":"), 2 ); } // Add the field to the list of options. - $options[t('Fields')]["{{ {$this->options['id']} }}"] = substr(strrchr($this->adminLabel(), ":"), 2 ); + $options['fields']["{{ {$this->options['id']} }}"] = substr(strrchr($this->adminLabel(), ":"), 2 ); $count = 0; // This lets us prepare the key as we want it printed. foreach ($this->view->display_handler->getHandlers('argument') as $arg => $handler) { - $options[t('Arguments')]['%' . ++$count] = $this->t('@argument title', array('@argument' => $handler->adminLabel())); - $options[t('Arguments')]['!' . $count] = $this->t('@argument input', array('@argument' => $handler->adminLabel())); + $options['arguments']['%' . ++$count] = $this->t('@argument title', array('@argument' => $handler->adminLabel())); + $options['arguments']['!' . $count] = $this->t('@argument input', array('@argument' => $handler->adminLabel())); } - $this->documentSelfTokens($options[t('Fields')]); + $this->documentSelfTokens($options[$fields]); // Default text. diff --git a/core/modules/views_ui/admin.inc b/core/modules/views_ui/admin.inc index 78be0fc..b6462ea 100644 --- a/core/modules/views_ui/admin.inc +++ b/core/modules/views_ui/admin.inc @@ -94,16 +94,18 @@ function views_ui_add_ajax_trigger(&$wrapping_element, $trigger_key, $refresh_pa // always give the button a unique #value, rather than playing around with // #name. $button_title = !empty($triggering_element['#title']) ? $triggering_element['#title'] : $trigger_key; - if (empty($seen_buttons[$button_title])) { + $button_title_string = (string) $button_title; + if (empty($seen_buttons[$button_title_string])) { + // This code relies on check_plain()'ing the string because of the quotes. $wrapping_element[$button_key]['#value'] = t('Update "@title" choice', array( '@title' => $button_title, )); - $seen_buttons[$button_title] = 1; + $seen_buttons[$button_title_string] = 1; } else { $wrapping_element[$button_key]['#value'] = t('Update "@title" choice (@number)', array( '@title' => $button_title, - '@number' => ++$seen_buttons[$button_title], + '@number' => ++$seen_buttons[$button_title_string], )); }