Loading core/tests/Drupal/KernelTests/Core/Theme/ClaroVerticalTabsTest.php +5 −5 Original line number Diff line number Diff line Loading @@ -26,9 +26,9 @@ public function testVerticalTabs() { $this->config('system.theme')->set('default', 'claro')->save(); $form = [ '#parents' => [], '#parents' => ['parent'], '#array_parents' => [], '#tree' => FALSE, '#tree' => TRUE, ]; $form['vertical_tabs'] = [ Loading @@ -38,7 +38,7 @@ public function testVerticalTabs() { $form['vertical_tabs_details'] = [ '#type' => 'details', '#title' => 'Details', '#group' => 'vertical_tabs', '#group' => 'parent][vertical_tabs', ]; // Needs to be rendered after the vertical tabs. Loading @@ -61,9 +61,9 @@ public function testVerticalTabs() { // Assert that the vertical tab details has the appropriate class. $this->assertCount(1, $this->cssSelect('.vertical-tabs__items details.vertical-tabs__item')); // Assert that there is a details element. $this->assertCount(1, $this->cssSelect('#edit-container-details')); $this->assertCount(1, $this->cssSelect('#edit-parent-container-details')); // Assert that details element doesn't have the vertical tab classes. $this->assertCount(0, $this->cssSelect('#edit-container-details.vertical-tabs__item')); $this->assertCount(0, $this->cssSelect('#edit-parent-container-details.vertical-tabs__item')); } } core/themes/claro/src/ClaroPreRender.php +4 −7 Original line number Diff line number Diff line Loading @@ -77,13 +77,10 @@ public static function verticalTabs($element) { $last_group_with_child_key = NULL; $last_group_with_child_key_last_child_key = NULL; // Only iterate through the parents instead of all the group keys. foreach ($element['#parents'] as $group_key) { // Check parents against groups because we are only looking for group // elements. if (!in_array($group_key, $group_keys)) { continue; } $group_key = implode('][', $element['#parents']); // Only check siblings against groups because we are only looking for // group elements. if (in_array($group_key, $group_keys)) { $children_keys = Element::children($element['group']['#groups'][$group_key], TRUE); foreach ($children_keys as $child_key) { Loading Loading
core/tests/Drupal/KernelTests/Core/Theme/ClaroVerticalTabsTest.php +5 −5 Original line number Diff line number Diff line Loading @@ -26,9 +26,9 @@ public function testVerticalTabs() { $this->config('system.theme')->set('default', 'claro')->save(); $form = [ '#parents' => [], '#parents' => ['parent'], '#array_parents' => [], '#tree' => FALSE, '#tree' => TRUE, ]; $form['vertical_tabs'] = [ Loading @@ -38,7 +38,7 @@ public function testVerticalTabs() { $form['vertical_tabs_details'] = [ '#type' => 'details', '#title' => 'Details', '#group' => 'vertical_tabs', '#group' => 'parent][vertical_tabs', ]; // Needs to be rendered after the vertical tabs. Loading @@ -61,9 +61,9 @@ public function testVerticalTabs() { // Assert that the vertical tab details has the appropriate class. $this->assertCount(1, $this->cssSelect('.vertical-tabs__items details.vertical-tabs__item')); // Assert that there is a details element. $this->assertCount(1, $this->cssSelect('#edit-container-details')); $this->assertCount(1, $this->cssSelect('#edit-parent-container-details')); // Assert that details element doesn't have the vertical tab classes. $this->assertCount(0, $this->cssSelect('#edit-container-details.vertical-tabs__item')); $this->assertCount(0, $this->cssSelect('#edit-parent-container-details.vertical-tabs__item')); } }
core/themes/claro/src/ClaroPreRender.php +4 −7 Original line number Diff line number Diff line Loading @@ -77,13 +77,10 @@ public static function verticalTabs($element) { $last_group_with_child_key = NULL; $last_group_with_child_key_last_child_key = NULL; // Only iterate through the parents instead of all the group keys. foreach ($element['#parents'] as $group_key) { // Check parents against groups because we are only looking for group // elements. if (!in_array($group_key, $group_keys)) { continue; } $group_key = implode('][', $element['#parents']); // Only check siblings against groups because we are only looking for // group elements. if (in_array($group_key, $group_keys)) { $children_keys = Element::children($element['group']['#groups'][$group_key], TRUE); foreach ($children_keys as $child_key) { Loading