Commit 169a8c12 authored by catch's avatar catch

Issue #857124 by lucascaro, Alan D., 30equals, tim.plunkett: Fixed Collapsible...

Issue #857124 by lucascaro, Alan D., 30equals, tim.plunkett: Fixed Collapsible fieldsets and vertical tabs do not work without form_builder() (Form API).
parent 277e4b1e
......@@ -3597,6 +3597,20 @@ function form_process_fieldset(&$element, &$form_state) {
// Contains form element summary functionalities.
$element['#attached']['library'][] = array('system', 'drupal.form');
return $element;
}
/**
* Adds members of this group as actual elements for rendering.
*
* @param $element
* An associative array containing the properties and children of the
* fieldset.
*
* @return
* The modified element with all group members.
*/
function form_pre_render_fieldset($element) {
// The .form-wrapper class is required for #states to treat fieldsets like
// containers.
if (!isset($element['#attributes']['class'])) {
......@@ -3612,20 +3626,6 @@ function form_process_fieldset(&$element, &$form_state) {
}
}
return $element;
}
/**
* Adds members of this group as actual elements for rendering.
*
* @param $element
* An associative array containing the properties and children of the
* fieldset.
*
* @return
* The modified element with all group members.
*/
function form_pre_render_fieldset($element) {
// Fieldsets may be rendered outside of a Form API context.
if (!isset($element['#parents']) || !isset($element['#groups'])) {
return $element;
......
......@@ -1821,6 +1821,15 @@ class CommonDrupalRenderTestCase extends DrupalWebTestCase {
':title' => $element['#title'],
));
$element = array(
'#type' => 'fieldset',
'#title' => $this->randomName(),
'#collapsible' => TRUE,
);
$this->assertRenderedElement($element, '//fieldset[contains(@class, :class)]', array(
':class' => 'collapsible',
));
$element['item'] = array(
'#type' => 'item',
'#title' => $this->randomName(),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment