Loading core/lib/Drupal/Core/Render/Element/CompositeFormElementTrait.php +1 −0 Changes for core/lib/Drupal/Core/Render/Element/CompositeFormElementTrait.php: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ public static function preRenderCompositeFormElement($element) { if (isset($element['#title']) || isset($element['#description'])) { // @see #type 'fieldgroup' $element['#attributes']['id'] = $element['#id'] . '--wrapper'; $element['#theme_wrappers'][] = 'fieldset'; $element['#attributes']['class'][] = 'fieldgroup'; $element['#attributes']['class'][] = 'form-composite'; Loading core/modules/system/src/Tests/Form/ElementTest.php +15 −0 Changes for core/modules/system/src/Tests/Form/ElementTest.php: 15 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -87,6 +87,21 @@ function testOptions() { } } /** * Tests wrapper ids for checkboxes and radios. */ function testWrapperIds() { $this->drupalGet('form-test/checkboxes-radios'); // Verify that wrapper id is different from element id. foreach (array('checkboxes', 'radios') as $type) { $element_ids = $this->xpath('//div[@id=:id]', array(':id' => 'edit-' . $type)); $wrapper_ids = $this->xpath('//fieldset[@id=:id]', array(':id' => 'edit-' . $type . '--wrapper')); $this->assertTrue(count($element_ids) == 1, format_string('A single element id found for type %type', array('%type' => $type))); $this->assertTrue(count($wrapper_ids) == 1, format_string('A single wrapper id found for type %type', array('%type' => $type))); } } /** * Tests button classes. */ Loading Loading
core/lib/Drupal/Core/Render/Element/CompositeFormElementTrait.php +1 −0 Changes for core/lib/Drupal/Core/Render/Element/CompositeFormElementTrait.php: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ public static function preRenderCompositeFormElement($element) { if (isset($element['#title']) || isset($element['#description'])) { // @see #type 'fieldgroup' $element['#attributes']['id'] = $element['#id'] . '--wrapper'; $element['#theme_wrappers'][] = 'fieldset'; $element['#attributes']['class'][] = 'fieldgroup'; $element['#attributes']['class'][] = 'form-composite'; Loading
core/modules/system/src/Tests/Form/ElementTest.php +15 −0 Changes for core/modules/system/src/Tests/Form/ElementTest.php: 15 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -87,6 +87,21 @@ function testOptions() { } } /** * Tests wrapper ids for checkboxes and radios. */ function testWrapperIds() { $this->drupalGet('form-test/checkboxes-radios'); // Verify that wrapper id is different from element id. foreach (array('checkboxes', 'radios') as $type) { $element_ids = $this->xpath('//div[@id=:id]', array(':id' => 'edit-' . $type)); $wrapper_ids = $this->xpath('//fieldset[@id=:id]', array(':id' => 'edit-' . $type . '--wrapper')); $this->assertTrue(count($element_ids) == 1, format_string('A single element id found for type %type', array('%type' => $type))); $this->assertTrue(count($wrapper_ids) == 1, format_string('A single wrapper id found for type %type', array('%type' => $type))); } } /** * Tests button classes. */ Loading