diff --git a/core/lib/Drupal/Core/Config/StorableConfigBase.php b/core/lib/Drupal/Core/Config/StorableConfigBase.php index 5c6e8b3..b9de0b6 100644 --- a/core/lib/Drupal/Core/Config/StorableConfigBase.php +++ b/core/lib/Drupal/Core/Config/StorableConfigBase.php @@ -9,6 +9,7 @@ use Drupal\Component\Utility\String; use Drupal\Core\Config\Schema\Ignore; +use Drupal\Core\StringTranslation\TranslationWrapper; use Drupal\Core\TypedData\PrimitiveInterface; use Drupal\Core\TypedData\Type\FloatInterface; use Drupal\Core\TypedData\Type\IntegerInterface; @@ -184,6 +185,10 @@ protected function castValue($key, $value) { $this->validateValue($key, $value); return $value; } + // Support translation wrappers. + if ($value instanceof TranslationWrapper) { + $value = (string) $value; + } if (is_scalar($value) || $value === NULL) { if ($element && $element instanceof PrimitiveInterface) { // Special handling for integers and floats since the configuration diff --git a/core/modules/views/src/Plugin/views/display/Page.php b/core/modules/views/src/Plugin/views/display/Page.php index 08da0a2..cd54540 100644 --- a/core/modules/views/src/Plugin/views/display/Page.php +++ b/core/modules/views/src/Plugin/views/display/Page.php @@ -46,9 +46,8 @@ protected function defineOptions() { $options['menu'] = array( 'contains' => array( 'type' => array('default' => 'none'), - // Do not translate menu and title as menu system will. - 'title' => array('default' => '', 'translatable' => FALSE), - 'description' => array('default' => '', 'translatable' => FALSE), + 'title' => array('default' => ''), + 'description' => array('default' => ''), 'weight' => array('default' => 0), 'menu_name' => array('default' => 'navigation'), 'parent' => array('default' => ''), @@ -58,11 +57,9 @@ protected function defineOptions() { $options['tab_options'] = array( 'contains' => array( 'type' => array('default' => 'none'), - // Do not translate menu and title as menu system will. - 'title' => array('default' => '', 'translatable' => FALSE), - 'description' => array('default' => '', 'translatable' => FALSE), + 'title' => array('default' => ''), + 'description' => array('default' => ''), 'weight' => array('default' => 0), - 'menu_name' => array('default' => 'navigation'), ), ); @@ -336,30 +333,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { ), ), ); - // Only display the menu selector if Menu UI module is enabled. - if (\Drupal::moduleHandler()->moduleExists('menu_ui')) { - $form['tab_options']['name'] = array( - '#title' => $this->t('Menu'), - '#type' => 'select', - '#options' => menu_ui_get_menus(), - '#default_value' => $tab_options['name'], - '#description' => $this->t('Insert item into an available menu.'), - '#states' => array( - 'visible' => array( - ':input[name="tab_options[type]"]' => array('value' => 'normal'), - ), - ), - ); - } - else { - $form['tab_options']['menu_name'] = array( - '#type' => 'value', - '#value' => $tab_options['menu_name'], - ); - $form['tab_options']['markup'] = array( - '#markup' => $this->t('Menu selection requires the activation of Menu UI module.'), - ); - } + $form['tab_options']['weight'] = array( '#suffix' => '', '#title' => $this->t('Tab weight'),