diff --git a/core/includes/form.inc b/core/includes/form.inc index b9180b2..6ea69d3 100644 --- a/core/includes/form.inc +++ b/core/includes/form.inc @@ -2851,8 +2851,8 @@ function form_get_options($element, $key) { * @param $variables * An associative array containing: * - element: An associative array containing the properties of the element. - * Properties used: #attributes, #children, #collapsed, #description, #id, - * #title, #value. + * Properties used: #attributes, #children, #description, #id, #title, + * #value. * * @ingroup themeable */ @@ -2897,8 +2897,8 @@ function theme_fieldset($variables) { * @param $variables * An associative array containing: * - element: An associative array containing the properties of the element. - * Properties used: #attributes, #children, #collapsed, #description, #id, - * #title, #value. + * Properties used: #attributes, #children, #description, #id, #title, + * #value. * * @ingroup themeable */ @@ -2915,7 +2915,7 @@ function theme_details($variables) { if (!empty($element['#attributes']['id'])) { $summary_attributes['aria-controls'] = $element['#attributes']['id']; } - $summary_attributes['aria-expanded'] = empty($element['#attributes']['open']) ? FALSE : TRUE; + $summary_attributes['aria-expanded'] = !empty($element['#attributes']['open']); $summary_attributes['aria-pressed'] = $summary_attributes['aria-expanded']; $output .= '' . $element['#title'] . ''; } @@ -3918,8 +3918,8 @@ function form_pre_render_details($element) { // Collapsible details. $element['#attached']['library'][] = array('system', 'drupal.collapse'); - if (empty($element['#collapsed'])) { - $element['#attributes']['open'] = 'open'; + if (!empty($element['#open'])) { + $element['#attributes']['open'] = 'open'; } return $element; diff --git a/core/lib/Drupal/Core/Database/Install/Tasks.php b/core/lib/Drupal/Core/Database/Install/Tasks.php index ab1f771..448593c 100644 --- a/core/lib/Drupal/Core/Database/Install/Tasks.php +++ b/core/lib/Drupal/Core/Database/Install/Tasks.php @@ -234,7 +234,6 @@ public function getFormOptions($database) { $form['advanced_options'] = array( '#type' => 'details', '#title' => st('Advanced options'), - '#collapsed' => TRUE, '#description' => st("These options are only necessary for some sites. If you're not sure what you should enter here, leave the default settings or check with your hosting provider."), '#weight' => 10, ); diff --git a/core/lib/Drupal/Core/FileTransfer/FileTransfer.php b/core/lib/Drupal/Core/FileTransfer/FileTransfer.php index 823e17e..95f440c 100644 --- a/core/lib/Drupal/Core/FileTransfer/FileTransfer.php +++ b/core/lib/Drupal/Core/FileTransfer/FileTransfer.php @@ -408,7 +408,6 @@ public function getSettingsForm() { $form['advanced'] = array( '#type' => 'details', '#title' => t('Advanced settings'), - '#collapsed' => TRUE, ); $form['advanced']['hostname'] = array( '#type' => 'textfield', diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Form/SettingsForm.php b/core/modules/aggregator/lib/Drupal/aggregator/Form/SettingsForm.php index 9a5cbde..2e74add 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Form/SettingsForm.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Form/SettingsForm.php @@ -131,7 +131,7 @@ public function buildForm(array $form, array &$form_state) { '#type' => 'details', '#title' => t('Basic configuration'), '#description' => t('For most aggregation tasks, the default settings are fine.'), - '#collapsed' => FALSE, + '#open' => TRUE, ); $form['basic_conf'] += $basic_conf; } diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/aggregator/processor/DefaultProcessor.php b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/aggregator/processor/DefaultProcessor.php index 08777d1..71cb6cc 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/aggregator/processor/DefaultProcessor.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/aggregator/processor/DefaultProcessor.php @@ -45,7 +45,7 @@ public function settingsForm(array $form, array &$form_state) { '#type' => 'details', '#title' => t('Default processor settings'), '#description' => $info['description'], - '#collapsed' => !in_array($info['id'], $processors), + '#open' => in_array($info['id'], $processors), ); } diff --git a/core/modules/aggregator/tests/lib/Drupal/aggregator_test/Plugin/aggregator/processor/TestProcessor.php b/core/modules/aggregator/tests/lib/Drupal/aggregator_test/Plugin/aggregator/processor/TestProcessor.php index 3ffe213..1b364a2 100644 --- a/core/modules/aggregator/tests/lib/Drupal/aggregator_test/Plugin/aggregator/processor/TestProcessor.php +++ b/core/modules/aggregator/tests/lib/Drupal/aggregator_test/Plugin/aggregator/processor/TestProcessor.php @@ -38,7 +38,7 @@ public function settingsForm(array $form, array &$form_state) { '#type' => 'details', '#title' => t('Test processor settings'), '#description' => $info['description'], - '#collapsed' => !in_array($info['id'], $processors), + '#open' => in_array($info['id'], $processors), ); // Add some dummy settings to verify settingsForm is called. $form['processors'][$info['id']]['dummy_length'] = array( diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockFormController.php b/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockFormController.php index 2c9845e..7e65ffa 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockFormController.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockFormController.php @@ -92,7 +92,7 @@ public function form(array $form, array &$form_state, EntityInterface $block) { '#title' => t('Revision information'), '#collapsible' => TRUE, // Collapsed by default when "Create new revision" is unchecked. - '#collapsed' => !$block->isNewRevision(), + '#open' => $block->isNewRevision(), '#group' => 'advanced', '#attributes' => array( 'class' => array('custom-block-form-revision-information'), diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockTypeFormController.php b/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockTypeFormController.php index 77664e9..738df91 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockTypeFormController.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockTypeFormController.php @@ -56,8 +56,6 @@ public function form(array $form, array &$form_state, EntityInterface $block_typ $form['language'] = array( '#type' => 'details', '#title' => t('Language settings'), - '#collapsible' => TRUE, - '#collapsed' => TRUE, '#group' => 'additional_settings', ); diff --git a/core/modules/block/lib/Drupal/block/BlockBase.php b/core/modules/block/lib/Drupal/block/BlockBase.php index 0909345..0d75242 100644 --- a/core/modules/block/lib/Drupal/block/BlockBase.php +++ b/core/modules/block/lib/Drupal/block/BlockBase.php @@ -285,7 +285,6 @@ public function form($form, &$form_state) { $form['visibility']['path'] = array( '#type' => 'details', '#title' => t('Pages'), - '#collapsed' => TRUE, '#group' => 'visibility', '#weight' => 0, ); @@ -348,7 +347,6 @@ public function form($form, &$form_state) { $form['visibility']['language'] = array( '#type' => 'details', '#title' => t('Languages'), - '#collapsed' => TRUE, '#group' => 'visibility', '#weight' => 5, ); @@ -381,7 +379,6 @@ public function form($form, &$form_state) { $form['visibility']['role'] = array( '#type' => 'details', '#title' => t('Roles'), - '#collapsed' => TRUE, '#group' => 'visibility', '#weight' => 10, ); diff --git a/core/modules/book/book.module b/core/modules/book/book.module index d97dcf1..c28d2fd 100644 --- a/core/modules/book/book.module +++ b/core/modules/book/book.module @@ -432,7 +432,6 @@ function _book_add_form_elements(&$form, &$form_state, EntityInterface $node) { '#type' => 'details', '#title' => t('Book outline'), '#weight' => 10, - '#collapsed' => TRUE, '#group' => 'advanced', '#attributes' => array( 'class' => array('book-outline-form'), diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index 5690c72..799521d 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -1005,7 +1005,6 @@ function comment_form_node_type_form_alter(&$form, $form_state) { $form['comment'] = array( '#type' => 'details', '#title' => t('Comment settings'), - '#collapsed' => TRUE, '#group' => 'additional_settings', '#attributes' => array( 'class' => array('comment-node-type-settings-form'), @@ -1111,7 +1110,6 @@ function comment_form_node_form_alter(&$form, $form_state) { '#type' => 'details', '#access' => user_access('administer comments'), '#title' => t('Comment settings'), - '#collapsed' => TRUE, '#group' => 'advanced', '#attributes' => array( 'class' => array('comment-node-settings-form'), diff --git a/core/modules/comment/lib/Drupal/comment/CommentFormController.php b/core/modules/comment/lib/Drupal/comment/CommentFormController.php index a5e5f15..d488f01 100644 --- a/core/modules/comment/lib/Drupal/comment/CommentFormController.php +++ b/core/modules/comment/lib/Drupal/comment/CommentFormController.php @@ -53,7 +53,6 @@ public function form(array $form, array &$form_state, EntityInterface $comment) $form['author'] += array( '#type' => 'details', '#title' => t('Administration'), - '#collapsed' => TRUE, ); } diff --git a/core/modules/dblog/dblog.admin.inc b/core/modules/dblog/dblog.admin.inc index d432b5b..e4c5e3d 100644 --- a/core/modules/dblog/dblog.admin.inc +++ b/core/modules/dblog/dblog.admin.inc @@ -326,7 +326,7 @@ function dblog_filter_form($form) { $form['filters'] = array( '#type' => 'details', '#title' => t('Filter log messages'), - '#collapsed' => empty($_SESSION['dblog_overview_filter']), + '#open' => !empty($_SESSION['dblog_overview_filter']), ); foreach ($filters as $key => $filter) { $form['filters']['status'][$key] = array( @@ -403,7 +403,6 @@ function dblog_clear_log_form($form) { '#type' => 'details', '#title' => t('Clear log messages'), '#description' => t('This will permanently remove the log messages from the database.'), - '#collapsed' => TRUE, ); $form['dblog_clear']['clear'] = array( '#type' => 'submit', diff --git a/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php b/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php index c288750..af18a1a 100644 --- a/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php +++ b/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php @@ -464,7 +464,6 @@ function multiple_options_form(&$form, &$form_state) { $form['multiple_field_settings'] = array( '#type' => 'details', '#title' => t('Multiple field settings'), - '#collapsed' => TRUE, '#weight' => 5, ); diff --git a/core/modules/field_ui/lib/Drupal/field_ui/DisplayOverview.php b/core/modules/field_ui/lib/Drupal/field_ui/DisplayOverview.php index 7ee40f4..821824c 100644 --- a/core/modules/field_ui/lib/Drupal/field_ui/DisplayOverview.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/DisplayOverview.php @@ -349,7 +349,6 @@ public function buildForm(array $form, array &$form_state) { $form['modes'] = array( '#type' => 'details', '#title' => t('Custom display settings'), - '#collapsed' => TRUE, ); // Collect options and default values for the 'Custom display settings' // checkboxes. diff --git a/core/modules/language/language.admin.inc b/core/modules/language/language.admin.inc index f59fb38..0b726e3 100644 --- a/core/modules/language/language.admin.inc +++ b/core/modules/language/language.admin.inc @@ -617,7 +617,6 @@ function language_negotiation_configure_browser_form($form, &$form_state) { $form['new_mapping'] = array( '#type' => 'details', '#title' => t('Add a new mapping'), - '#collapsed' => TRUE, '#tree' => TRUE, ); $form['new_mapping']['browser_langcode'] = array( diff --git a/core/modules/locale/locale.bulk.inc b/core/modules/locale/locale.bulk.inc index 49273d8..14ec0ae 100644 --- a/core/modules/locale/locale.bulk.inc +++ b/core/modules/locale/locale.bulk.inc @@ -177,7 +177,6 @@ function locale_translate_export_form($form, &$form_state) { $form['content_options'] = array( '#type' => 'details', '#title' => t('Export options'), - '#collapsed' => TRUE, '#tree' => TRUE, '#states' => array( 'invisible' => array( diff --git a/core/modules/locale/locale.pages.inc b/core/modules/locale/locale.pages.inc index fc68a51..9ac1d94 100644 --- a/core/modules/locale/locale.pages.inc +++ b/core/modules/locale/locale.pages.inc @@ -169,7 +169,7 @@ function locale_translate_filter_form($form, &$form_state) { $form['filters'] = array( '#type' => 'details', '#title' => t('Filter translatable strings'), - '#collapsed' => FALSE, + '#open' => TRUE, ); foreach ($filters as $key => $filter) { // Special case for 'string' filter. diff --git a/core/modules/menu/menu.module b/core/modules/menu/menu.module index d13655e..adec17d 100644 --- a/core/modules/menu/menu.module +++ b/core/modules/menu/menu.module @@ -554,7 +554,7 @@ function menu_form_node_form_alter(&$form, $form_state) { '#type' => 'details', '#title' => t('Menu settings'), '#access' => user_access('administer menu'), - '#collapsed' => !$link['link_title'], + '#open' => !empty($link['link_title']), '#group' => 'advanced', '#attached' => array( 'library' => array(array('menu', 'drupal.menu')), @@ -654,7 +654,6 @@ function menu_form_node_type_form_alter(&$form, $form_state) { $form['menu'] = array( '#type' => 'details', '#title' => t('Menu settings'), - '#collapsed' => TRUE, '#attached' => array( 'library' => array(array('menu', 'drupal.menu.admin')), ), diff --git a/core/modules/node/content_types.inc b/core/modules/node/content_types.inc index f8b144a..68838b2 100644 --- a/core/modules/node/content_types.inc +++ b/core/modules/node/content_types.inc @@ -192,7 +192,6 @@ function node_type_form($form, &$form_state, $type = NULL) { $form['workflow'] = array( '#type' => 'details', '#title' => t('Publishing options'), - '#collapsed' => TRUE, '#group' => 'additional_settings', ); $form['workflow']['node_options'] = array('#type' => 'checkboxes', @@ -210,7 +209,6 @@ function node_type_form($form, &$form_state, $type = NULL) { $form['language'] = array( '#type' => 'details', '#title' => t('Language settings'), - '#collapsed' => TRUE, '#group' => 'additional_settings', ); @@ -229,7 +227,6 @@ function node_type_form($form, &$form_state, $type = NULL) { $form['display'] = array( '#type' => 'details', '#title' => t('Display settings'), - '#collapsed' => TRUE, '#group' => 'additional_settings', ); $form['display']['node_submitted'] = array( diff --git a/core/modules/node/lib/Drupal/node/NodeFormController.php b/core/modules/node/lib/Drupal/node/NodeFormController.php index 63b4189..436b1de 100644 --- a/core/modules/node/lib/Drupal/node/NodeFormController.php +++ b/core/modules/node/lib/Drupal/node/NodeFormController.php @@ -123,7 +123,7 @@ public function form(array $form, array &$form_state, EntityInterface $node) { '#group' => 'advanced', '#title' => t('Revision information'), // Collapsed by default when "Create new revision" is unchecked. - '#collapsed' => !$node->isNewRevision(), + '#open' => $node->isNewRevision(), '#attributes' => array( 'class' => array('node-form-revision-information'), ), @@ -159,7 +159,6 @@ public function form(array $form, array &$form_state, EntityInterface $node) { '#type' => 'details', '#access' => user_access('administer nodes'), '#title' => t('Authoring information'), - '#collapsed' => TRUE, '#group' => 'advanced', '#attributes' => array( 'class' => array('node-form-author'), @@ -198,7 +197,6 @@ public function form(array $form, array &$form_state, EntityInterface $node) { '#type' => 'details', '#access' => user_access('administer nodes'), '#title' => t('Promotion options'), - '#collapsed' => TRUE, '#group' => 'advanced', '#attributes' => array( 'class' => array('node-form-options'), diff --git a/core/modules/node/node.module b/core/modules/node/node.module index f663387..9264afa 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -2001,7 +2001,6 @@ function node_form_block_form_alter(&$form, &$form_state) { $form['visibility']['node_type'] = array( '#type' => 'details', '#title' => t('Content types'), - '#collapsed' => TRUE, '#group' => 'visibility', '#weight' => 5, ); @@ -2277,7 +2276,6 @@ function node_form_search_form_alter(&$form, $form_state) { $form['advanced'] = array( '#type' => 'details', '#title' => t('Advanced search'), - '#collapsed' => TRUE, '#attributes' => array('class' => array('search-advanced')), ); $form['advanced']['keywords-fieldset'] = array( @@ -2338,10 +2336,9 @@ function node_form_search_form_alter(&$form, $form_state) { } if (count($language_options) > 1) { $form['advanced']['lang-fieldset'] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('Languages'), - '#collapsible' => FALSE, - '#collapsed' => FALSE, + '#open' => TRUE, ); $form['advanced']['lang-fieldset']['language'] = array( '#type' => 'checkboxes', diff --git a/core/modules/path/path.module b/core/modules/path/path.module index cee17ed..b8ec625 100644 --- a/core/modules/path/path.module +++ b/core/modules/path/path.module @@ -118,7 +118,7 @@ function path_form_node_form_alter(&$form, $form_state) { $form['path'] = array( '#type' => 'details', '#title' => t('URL path settings'), - '#collapsed' => empty($path['alias']), + '#open' => !empty($path['alias']), '#group' => 'advanced', '#attributes' => array( 'class' => array('path-form'), diff --git a/core/modules/simpletest/lib/Drupal/simpletest/Form/SimpletestSettingsForm.php b/core/modules/simpletest/lib/Drupal/simpletest/Form/SimpletestSettingsForm.php index cce1a8a..917b935 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/Form/SimpletestSettingsForm.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/Form/SimpletestSettingsForm.php @@ -46,7 +46,6 @@ public function buildForm(array $form, array &$form_state) { '#type' => 'details', '#title' => t('HTTP authentication'), '#description' => t('HTTP auth settings to be used by the SimpleTest browser during testing. Useful when the site requires basic HTTP authentication.'), - '#collapsed' => TRUE, ); $form['httpauth']['simpletest_httpauth_method'] = array( '#type' => 'select', diff --git a/core/modules/simpletest/simpletest.pages.inc b/core/modules/simpletest/simpletest.pages.inc index 4fb908d..e5f8590 100644 --- a/core/modules/simpletest/simpletest.pages.inc +++ b/core/modules/simpletest/simpletest.pages.inc @@ -25,10 +25,6 @@ function simpletest_test_form($form, &$form_state) { $form_state['storage']['PHPUnit'] = $groups['PHPUnit']; foreach ($groups as $group => $tests) { - $form['tests']['table'][$group] = array( - '#collapsed' => TRUE, - ); - foreach ($tests as $class => $info) { $form['tests']['table'][$group][$class] = array( '#type' => 'checkbox', @@ -98,8 +94,8 @@ function theme_simpletest_test_table($variables) { // Select the right "expand"/"collapse" image, depending on whether the // category is expanded (at least one test selected) or not. - $collapsed = !empty($element['#collapsed']); - $image_index = $collapsed ? 0 : 1; + $open = !empty($element['#open']); + $image_index = (int) $open; // Place-holder for checkboxes to select group of tests. $row[] = array('id' => $test_class, 'class' => array('simpletest-select-all')); @@ -159,7 +155,7 @@ function theme_simpletest_test_table($variables) { 'class' => array('simpletest-test-description'), ); - $rows[] = array('data' => $row, 'class' => array($test_class . '-test', ($collapsed ? 'js-hide' : ''))); + $rows[] = array('data' => $row, 'class' => array($test_class . '-test', ($open ? '' : 'js-hide'))); } $js['simpletest-test-group-' . $test_class] = $current_js; unset($table[$key]); @@ -281,7 +277,7 @@ function simpletest_result_form($form, &$form_state, $test_id) { // Set summary information. $group_summary['#ok'] = $group_summary['#fail'] + $group_summary['#exception'] == 0; - $form['result']['results'][$group]['#collapsed'] = $group_summary['#ok']; + $form['result']['results'][$group]['#open'] = !$group_summary['#ok']; // Store test group (class) as for use in filter. $filter[$group_summary['#ok'] ? 'pass' : 'fail'][] = $group; diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc index e0be14f..4327c34df 100644 --- a/core/modules/system/system.admin.inc +++ b/core/modules/system/system.admin.inc @@ -1858,10 +1858,10 @@ function system_image_toolkit_settings($form, &$form_state) { foreach ($toolkits_available as $id => $definition) { $toolkit = $manager->createInstance($id); $form['image_toolkit_settings'][$id] = array( - '#type' => 'fieldset', + '#type' => 'details', '#title' => t('@toolkit settings', array('@toolkit' => $definition['title'])), '#collapsible' => TRUE, - '#collapsed' => ($id == $current_toolkit) ? FALSE : TRUE, + '#open' => ($id == $current_toolkit), '#tree' => TRUE, ); $form['image_toolkit_settings'][$id] += $toolkit->settingsForm(); diff --git a/core/modules/system/system.module b/core/modules/system/system.module index eee53b1..5a70217 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -554,7 +554,7 @@ function system_element_info() { '#theme_wrappers' => array('fieldset'), ); $types['details'] = array( - '#collapsed' => FALSE, + '#open' => FALSE, '#value' => NULL, '#process' => array('form_process_group', 'ajax_process_form'), '#pre_render' => array('form_pre_render_details', 'form_pre_render_group'), diff --git a/core/modules/system/tests/modules/design_test/form/details.inc b/core/modules/system/tests/modules/design_test/form/details.inc index 60d153a..7925de0 100644 --- a/core/modules/system/tests/modules/design_test/form/details.inc +++ b/core/modules/system/tests/modules/design_test/form/details.inc @@ -13,7 +13,7 @@ function design_test_form_details($form, &$form_state) { '#type' => 'details', '#title' => 'Collapsible details', '#description' => 'Details description', - '#collapsed' => FALSE, + '#open' => TRUE, '#states' => array( 'collapsed' => array( ':input[name="states-trigger"]' => array('checked' => TRUE), @@ -25,7 +25,6 @@ function design_test_form_details($form, &$form_state) { '#type' => 'details', '#title' => 'Collapsed details', '#description' => 'Details description', - '#collapsed' => TRUE, ); $form['collapsed']['textfield'] = array( '#type' => 'textfield', @@ -46,19 +45,17 @@ function design_test_form_details($form, &$form_state) { '#type' => 'details', '#title' => 'Details', '#description' => 'Details description', - '#collapsed' => TRUE, ); $form['collapsed2']['collapsible'] = array( '#type' => 'details', '#title' => 'Collapsible details', '#description' => 'Details description', - '#collapsed' => FALSE, + '#open' => TRUE, ); $form['collapsed2']['collapsed'] = array( '#type' => 'details', '#title' => 'Collapsed details', '#description' => 'Details description', - '#collapsed' => TRUE, ); $form['collapsed2']['regular'] = array( '#type' => 'details', diff --git a/core/modules/system/tests/modules/design_test/form/fieldset.inc b/core/modules/system/tests/modules/design_test/form/fieldset.inc index f55bfe5..8b57dde 100644 --- a/core/modules/system/tests/modules/design_test/form/fieldset.inc +++ b/core/modules/system/tests/modules/design_test/form/fieldset.inc @@ -19,7 +19,7 @@ function design_test_form_fieldset($form, &$form_state) { '#type' => 'details', '#title' => 'Collapsible details', '#description' => 'Details description', - '#collapsed' => FALSE, + '#open' => TRUE, ); $form['collapsible']['fieldset'] = array( '#type' => 'fieldset', @@ -40,7 +40,7 @@ function design_test_form_fieldset($form, &$form_state) { $form['collapsed'] = $form['collapsible']; $form['collapsed']['#title'] = 'Collapsed details'; - $form['collapsed']['#collapsed'] = TRUE; + $form['collapsed']['#open'] = FALSE; $form['nested'] = $form['regular']; $form['nested']['#title'] = 'Parent fieldset'; diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/TermFormController.php b/core/modules/taxonomy/lib/Drupal/taxonomy/TermFormController.php index 3735ad6..7a780f7 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/TermFormController.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/TermFormController.php @@ -53,7 +53,7 @@ public function form(array $form, array &$form_state, EntityInterface $term) { $form['relations'] = array( '#type' => 'details', '#title' => t('Relations'), - '#collapsed' => ($vocabulary->hierarchy != TAXONOMY_HIERARCHY_MULTIPLE), + '#open' => ($vocabulary->hierarchy == TAXONOMY_HIERARCHY_MULTIPLE), '#weight' => 10, ); diff --git a/core/modules/translation/translation.module b/core/modules/translation/translation.module index 41d8e83..55e0937 100644 --- a/core/modules/translation/translation.module +++ b/core/modules/translation/translation.module @@ -215,7 +215,7 @@ function translation_form_node_form_alter(&$form, &$form_state) { '#type' => 'details', '#title' => t('Translation settings'), '#access' => translation_user_can_translate_node($node), - '#collapsed' => !$node->translate, + '#open' => $node->translate, '#tree' => TRUE, '#weight' => 30, ); diff --git a/core/modules/translation_entity/lib/Drupal/translation_entity/EntityTranslationController.php b/core/modules/translation_entity/lib/Drupal/translation_entity/EntityTranslationController.php index ce9d3a0..5eb42a1 100644 --- a/core/modules/translation_entity/lib/Drupal/translation_entity/EntityTranslationController.php +++ b/core/modules/translation_entity/lib/Drupal/translation_entity/EntityTranslationController.php @@ -156,7 +156,6 @@ public function entityFormAlter(array &$form, array &$form_state, EntityInterfac $form['source_langcode'] = array( '#type' => 'details', '#title' => t('Source language: @language', array('@language' => $languages[$source_langcode]->name)), - '#collapsed' => TRUE, '#tree' => TRUE, '#weight' => -100, '#multilingual' => TRUE, @@ -224,7 +223,6 @@ public function entityFormAlter(array &$form, array &$form_state, EntityInterfac $form['translation_entity'] = array( '#type' => 'details', '#title' => t('Translation'), - '#collapsed' => TRUE, '#tree' => TRUE, '#weight' => 10, '#access' => $this->getTranslationAccess($entity, $source_langcode ? 'create' : 'update'), diff --git a/core/modules/user/lib/Drupal/user/AccountSettingsForm.php b/core/modules/user/lib/Drupal/user/AccountSettingsForm.php index b3d0d17..0cabd0b 100644 --- a/core/modules/user/lib/Drupal/user/AccountSettingsForm.php +++ b/core/modules/user/lib/Drupal/user/AccountSettingsForm.php @@ -182,7 +182,7 @@ public function buildForm(array $form, array &$form_state) { $form['email_admin_created'] = array( '#type' => 'details', '#title' => t('Welcome (new user created by administrator)'), - '#collapsed' => ($config->get('register') != USER_REGISTER_ADMINISTRATORS_ONLY), + '#open' => ($config->get('register') == USER_REGISTER_ADMINISTRATORS_ONLY), '#description' => t('Edit the welcome e-mail messages sent to new member accounts created by an administrator.') . ' ' . $email_token_help, '#group' => 'email', ); @@ -202,7 +202,7 @@ public function buildForm(array $form, array &$form_state) { $form['email_pending_approval'] = array( '#type' => 'details', '#title' => t('Welcome (awaiting approval)'), - '#collapsed' => ($config->get('register') != USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL), + '#open' => ($config->get('register') == USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL), '#description' => t('Edit the welcome e-mail messages sent to new members upon registering, when administrative approval is required.') . ' ' . $email_token_help, '#group' => 'email', ); @@ -222,7 +222,7 @@ public function buildForm(array $form, array &$form_state) { $form['email_pending_approval_admin'] = array( '#type' => 'details', '#title' => t('Admin (user awaiting approval)'), - '#collapsed' => ($config->get('register') != USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL), + '#open' => ($config->get('register') == USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL), '#description' => t('Edit the e-mail notifying the site administrator that there are new members awaiting administrative approval.') . ' ' . $email_token_help, '#group' => 'email', ); @@ -242,7 +242,7 @@ public function buildForm(array $form, array &$form_state) { $form['email_no_approval_required'] = array( '#type' => 'details', '#title' => t('Welcome (no approval required)'), - '#collapsed' => ($config->get('register') != USER_REGISTER_VISITORS), + '#open' => ($config->get('register') == USER_REGISTER_VISITORS), '#description' => t('Edit the welcome e-mail messages sent to new members upon registering, when no administrator approval is required.') . ' ' . $email_token_help, '#group' => 'email', ); @@ -262,7 +262,6 @@ public function buildForm(array $form, array &$form_state) { $form['email_password_reset'] = array( '#type' => 'details', '#title' => t('Password recovery'), - '#collapsed' => TRUE, '#description' => t('Edit the e-mail messages sent to users who request a new password.') . ' ' . $email_token_help, '#group' => 'email', '#weight' => 10, @@ -283,7 +282,6 @@ public function buildForm(array $form, array &$form_state) { $form['email_activated'] = array( '#type' => 'details', '#title' => t('Account activation'), - '#collapsed' => TRUE, '#description' => t('Enable and edit e-mail messages sent to users upon account activation (when an administrator activates an account of a user who has already registered, on a site where administrative approval is required).') . ' ' . $email_token_help, '#group' => 'email', ); @@ -317,7 +315,6 @@ public function buildForm(array $form, array &$form_state) { $form['email_blocked'] = array( '#type' => 'details', '#title' => t('Account blocked'), - '#collapsed' => TRUE, '#description' => t('Enable and edit e-mail messages sent to users when their accounts are blocked.') . ' ' . $email_token_help, '#group' => 'email', ); @@ -351,7 +348,6 @@ public function buildForm(array $form, array &$form_state) { $form['email_cancel_confirm'] = array( '#type' => 'details', '#title' => t('Account cancellation confirmation'), - '#collapsed' => TRUE, '#description' => t('Edit the e-mail messages sent to users when they attempt to cancel their accounts.') . ' ' . $email_token_help, '#group' => 'email', ); @@ -371,7 +367,6 @@ public function buildForm(array $form, array &$form_state) { $form['email_canceled'] = array( '#type' => 'details', '#title' => t('Account canceled'), - '#collapsed' => TRUE, '#description' => t('Enable and edit e-mail messages sent to users when their accounts are canceled.') . ' ' . $email_token_help, '#group' => 'email', ); diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php index 3b88f06..5d79431 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php @@ -291,7 +291,6 @@ public function buildOptionsForm(&$form, &$form_state) { $form['more'] = array( '#type' => 'details', '#title' => t('More'), - '#collapsed' => TRUE, '#weight' => 150, ); // Allow to alter the default values brought into the form. diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/PluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/PluginBase.php index 2c36002..248cd2d 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/PluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/PluginBase.php @@ -320,7 +320,6 @@ public function globalTokenForm(&$form, &$form_state) { $form['global_tokens'] = array( '#type' => 'fieldset', '#title' => t('Available global token replacements'), - '#collapsed' => TRUE, ); $form['global_tokens']['list'] = array( '#theme' => 'item_list', diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/area/AreaPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/area/AreaPluginBase.php index a8cfb8a..e2e1cd5 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/area/AreaPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/area/AreaPluginBase.php @@ -107,7 +107,6 @@ public function tokenForm(&$form, &$form_state) { $form['tokens'] = array( '#type' => 'details', '#title' => t('Replacement patterns'), - '#collapsed' => TRUE, '#id' => 'edit-options-token-help', '#states' => array( 'visible' => array( diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php index 117ade9..83c9347 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php @@ -193,7 +193,6 @@ public function buildOptionsForm(&$form, &$form_state) { $form['exception'] = array( '#type' => 'details', '#title' => t('Exceptions'), - '#collapsed' => TRUE, '#fieldset' => 'no_argument', ); $form['exception']['value'] = array( diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php index bc8dfff..f59aacc 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php @@ -535,7 +535,6 @@ public function buildOptionsForm(&$form, &$form_state) { $form['style_settings'] = array( '#type' => 'details', '#title' => t('Style settings'), - '#collapsed' => TRUE, '#weight' => 99, ); @@ -684,7 +683,6 @@ public function buildOptionsForm(&$form, &$form_state) { $form['alter'] = array( '#title' => t('Rewrite results'), '#type' => 'details', - '#collapsed' => TRUE, '#weight' => 100, ); @@ -885,7 +883,6 @@ public function buildOptionsForm(&$form, &$form_state) { $form['alter']['help'] = array( '#type' => 'details', '#title' => t('Replacement patterns'), - '#collapsed' => TRUE, '#value' => $output, '#states' => array( 'visible' => array( @@ -1024,7 +1021,6 @@ public function buildOptionsForm(&$form, &$form_state) { $form['empty_field_behavior'] = array( '#type' => 'details', '#title' => t('No results behavior'), - '#collapsed' => TRUE, '#weight' => 100, ); diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/pager/SqlBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/pager/SqlBase.php index f96a938..2026be8 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/pager/SqlBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/pager/SqlBase.php @@ -75,7 +75,7 @@ public function buildOptionsForm(&$form, &$form_state) { $form['tags'] = array( '#type' => 'details', - '#collapsed' => FALSE, + '#open' => TRUE, '#tree' => TRUE, '#title' => t('Pager link labels'), '#input' => TRUE, @@ -95,7 +95,7 @@ public function buildOptionsForm(&$form, &$form_state) { $form['expose'] = array( '#type' => 'details', - '#collapsed' => FALSE, + '#open' => TRUE, '#tree' => TRUE, '#title' => t('Exposed options'), '#input' => TRUE, diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/row/RssFields.php b/core/modules/views/lib/Drupal/views/Plugin/views/row/RssFields.php index 67b1004..a5bd242 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/row/RssFields.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/row/RssFields.php @@ -92,7 +92,7 @@ public function buildOptionsForm(&$form, &$form_state) { $form['guid_field_options'] = array( '#type' => 'details', '#title' => t('GUID settings'), - '#collapsed' => FALSE, + '#open' => TRUE, ); $form['guid_field_options']['guid_field'] = array( '#type' => 'select', diff --git a/core/modules/views/views_ui/lib/Drupal/views_ui/ViewEditFormController.php b/core/modules/views/views_ui/lib/Drupal/views_ui/ViewEditFormController.php index ade339a..461078a 100644 --- a/core/modules/views/views_ui/lib/Drupal/views_ui/ViewEditFormController.php +++ b/core/modules/views/views_ui/lib/Drupal/views_ui/ViewEditFormController.php @@ -472,7 +472,6 @@ public function getDisplayDetails($view, $display) { $build['columns']['third'] = array( '#type' => 'details', '#title' => t('Advanced'), - '#collapsed' => TRUE, '#theme_wrappers' => array('details', 'container'), '#attributes' => array( 'class' => array( @@ -483,9 +482,7 @@ public function getDisplayDetails($view, $display) { ); // Collapse the details by default. - if (config('views.settings')->get('ui.show.advanced_column')) { - $build['columns']['third']['#collapsed'] = FALSE; - } + $build['columns']['third']['#open'] = config('views.settings')->get('ui.show.advanced_column'); // Each option (e.g. title, access, display as grid/table/list) fits into one // of several "buckets," or boxes (Format, Fields, Sort, and so on). diff --git a/core/update.php b/core/update.php index 4947d09..3144c1b 100644 --- a/core/update.php +++ b/core/update.php @@ -67,7 +67,6 @@ function update_script_selection_form($form, &$form_state) { $form['start'] = array( '#tree' => TRUE, '#type' => 'details', - '#collapsed' => TRUE, ); // Ensure system.module's updates appear first.