diff --git a/core/modules/system/config/schema/system.schema.yml b/core/modules/system/config/schema/system.schema.yml index 46198c1..0caa989 100644 --- a/core/modules/system/config/schema/system.schema.yml +++ b/core/modules/system/config/schema/system.schema.yml @@ -377,7 +377,7 @@ block.settings.system_branding_block: block.settings.system_menu_block: type: block_settings - label: 'Branding block' + label: 'Menu block' mapping: level: type: integer diff --git a/core/modules/system/src/Plugin/Block/SystemMenuBlock.php b/core/modules/system/src/Plugin/Block/SystemMenuBlock.php index 26677d6..5b65569 100644 --- a/core/modules/system/src/Plugin/Block/SystemMenuBlock.php +++ b/core/modules/system/src/Plugin/Block/SystemMenuBlock.php @@ -86,15 +86,15 @@ public function blockForm($form, FormStateInterface $form_state) { '#title' => $this->t('Starting level'), '#default_value' => $config['level'], '#options' => array( - '1' => $this->t('1st level (primary)'), - '2' => $this->t('2nd level (secondary)'), - '3' => $this->t('3rd level (tertiary)'), - '4' => $this->t('4th level'), - '5' => $this->t('5th level'), - '6' => $this->t('6th level'), - '7' => $this->t('7th level'), - '8' => $this->t('8th level'), - '9' => $this->t('9th level'), + 1 => $this->t('1st level (primary)'), + 2 => $this->t('2nd level (secondary)'), + 3 => $this->t('3rd level (tertiary)'), + 4 => $this->t('4th level'), + 5 => $this->t('5th level'), + 6 => $this->t('6th level'), + 7 => $this->t('7th level'), + 8 => $this->t('8th level'), + 9 => $this->t('9th level'), ), '#description' => $this->t('Blocks that start with the 1st level will always be visible. Blocks that start with the 2nd level or deeper will only be visible when the trail to the active menu passes through the block’s starting level.'), '#required' => TRUE, @@ -105,16 +105,16 @@ public function blockForm($form, FormStateInterface $form_state) { '#title' => $this->t('Maximum number of levels'), '#default_value' => $config['depth'], '#options' => array( - '1' => '1', - '2' => '2', - '3' => '3', - '4' => '4', - '5' => '5', - '6' => '6', - '7' => '7', - '8' => '8', - '9' => '9', - '0' => $this->t('Unlimited'), + 1 => '1', + 2 => '2', + 3 => '3', + 4 => '4', + 5 => '5', + 6 => '6', + 7 => '7', + 8 => '8', + 9 => '9', + 0 => $this->t('Unlimited'), ), '#description' => $this->t('Specify the maximum number of levels of the menu tree to display, beginning with the starting level.'), '#required' => TRUE, @@ -136,7 +136,7 @@ public function build() { $parameters = $this->menuTree->getCurrentRouteMenuTreeParameters($menu_name); // Determine the max depth based on level and depth setting. - $max_depth = ($depth == 0) ? NULL : min($level + $depth - 1, $this->menuTree->maxDepth()); + $max_depth = ($depth === 0) ? NULL : min($level + $depth - 1, $this->menuTree->maxDepth()); $parameters->setMinDepth($level); $parameters->setMaxDepth($max_depth); @@ -165,8 +165,8 @@ public function defaultConfiguration() { // 2) modules can modify caching by implementing hook_block_view_alter() return array( 'cache' => array('max_age' => \Drupal\Core\Cache\Cache::PERMANENT), - 'level' => 1, - 'depth' => 0, + 'level' => '1', + 'depth' => '0', ); }