diff --git a/core/modules/views/src/Plugin/views/HandlerBase.php b/core/modules/views/src/Plugin/views/HandlerBase.php index 5f9842fd1a1b9ea3246d1bf1a749f6c198fe50fa..47e0c13c7d1f2ce29dc0c4bdb9914999b4045ead 100644 --- a/core/modules/views/src/Plugin/views/HandlerBase.php +++ b/core/modules/views/src/Plugin/views/HandlerBase.php @@ -305,7 +305,9 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { '#type' => 'details', '#title' => $this->t('More'), '#weight' => 200, + '#optional' => TRUE, ); + // Allow to alter the default values brought into the form. // @todo Do we really want to keep this hook. $this->getModuleHandler()->alter('views_handler_options', $this->options, $this->view); diff --git a/core/modules/views/src/Plugin/views/PluginBase.php b/core/modules/views/src/Plugin/views/PluginBase.php index cf00382376ef6b34d3a9f9427ebeb7e589e180e7..d84496995ed62ff1f1548623b4d6fcec6a2194b9 100644 --- a/core/modules/views/src/Plugin/views/PluginBase.php +++ b/core/modules/views/src/Plugin/views/PluginBase.php @@ -483,7 +483,6 @@ public static function preRenderAddFieldsetMarkup(array $form) { unset($form[$key]); } } - return $form; } diff --git a/core/modules/views/src/Plugin/views/argument/ManyToOne.php b/core/modules/views/src/Plugin/views/argument/ManyToOne.php index 781ea80bb973e588fe021c5b8a0c2d221dff1b1c..7c6367ad882d9fbe09089f631ada3129251ac6f3 100644 --- a/core/modules/views/src/Plugin/views/argument/ManyToOne.php +++ b/core/modules/views/src/Plugin/views/argument/ManyToOne.php @@ -72,7 +72,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { '#title' => $this->t('Allow multiple values'), '#description' => $this->t('If selected, users can enter multiple values in the form of 1+2+3 (for OR) or 1,2,3 (for AND).'), '#default_value' => !empty($this->options['break_phrase']), - '#fieldset' => 'more', + '#group' => 'options][more', ); $form['add_table'] = array( @@ -80,14 +80,14 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { '#title' => $this->t('Allow multiple filter values to work together'), '#description' => $this->t('If selected, multiple instances of this filter can work together, as though multiple values were supplied to the same filter. This setting is not compatible with the "Reduce duplicates" setting.'), '#default_value' => !empty($this->options['add_table']), - '#fieldset' => 'more', + '#group' => 'options][more', ); $form['require_value'] = array( '#type' => 'checkbox', '#title' => $this->t('Do not display items with no value in summary'), '#default_value' => !empty($this->options['require_value']), - '#fieldset' => 'more', + '#group' => 'options][more', ); $this->helper->buildOptionsForm($form, $form_state); diff --git a/core/modules/views/src/Plugin/views/argument/NullArgument.php b/core/modules/views/src/Plugin/views/argument/NullArgument.php index d21ce521f57eebdbce24c3eecc2c2ebe04cff87d..9d654fe513dccaaaf2276730c8815fc45e32f61c 100644 --- a/core/modules/views/src/Plugin/views/argument/NullArgument.php +++ b/core/modules/views/src/Plugin/views/argument/NullArgument.php @@ -35,7 +35,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { '#title' => $this->t('Fail basic validation if any argument is given'), '#default_value' => !empty($this->options['must_not_be']), '#description' => $this->t('By checking this field, you can use this to make sure views with more arguments than necessary fail validation.'), - '#fieldset' => 'more', + '#group' => 'options][more', ); unset($form['exception']); diff --git a/core/modules/views/src/Plugin/views/argument/NumericArgument.php b/core/modules/views/src/Plugin/views/argument/NumericArgument.php index 799d5cbeaf3c6b3135ce142ffb7aa9cf1e22079f..02e58f09821154130bc217b3da5641741a62ee34 100644 --- a/core/modules/views/src/Plugin/views/argument/NumericArgument.php +++ b/core/modules/views/src/Plugin/views/argument/NumericArgument.php @@ -49,7 +49,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { '#title' => $this->t('Allow multiple values'), '#description' => $this->t('If selected, users can enter multiple values in the form of 1+2+3 (for OR) or 1,2,3 (for AND).'), '#default_value' => !empty($this->options['break_phrase']), - '#fieldset' => 'more', + '#group' => 'options][more', ); $form['not'] = array( @@ -57,7 +57,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { '#title' => $this->t('Exclude'), '#description' => $this->t('If selected, the numbers entered for the filter will be excluded rather than limiting the view.'), '#default_value' => !empty($this->options['not']), - '#fieldset' => 'more', + '#group' => 'options][more', ); } diff --git a/core/modules/views/src/Plugin/views/argument/StringArgument.php b/core/modules/views/src/Plugin/views/argument/StringArgument.php index 8acd795f8203c86d0d36fbba4436ed6172241edd..409f10de1330626b6253da212567638e7cbf62be 100644 --- a/core/modules/views/src/Plugin/views/argument/StringArgument.php +++ b/core/modules/views/src/Plugin/views/argument/StringArgument.php @@ -65,7 +65,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { '#title' => $this->t('Glossary mode'), '#description' => $this->t('Glossary mode applies a limit to the number of characters used in the filter value, which allows the summary view to act as a glossary.'), '#default_value' => $this->options['glossary'], - '#fieldset' => 'more', + '#group' => 'options][more', ); $form['limit'] = array( @@ -78,7 +78,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { ':input[name="options[glossary]"]' => array('checked' => TRUE), ), ), - '#fieldset' => 'more', + '#group' => 'options][more', ); $form['case'] = array( @@ -93,7 +93,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { 'ucwords' => $this->t('Capitalize each word'), ), '#default_value' => $this->options['case'], - '#fieldset' => 'more', + '#group' => 'options][more', ); $form['path_case'] = array( @@ -108,14 +108,14 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { 'ucwords' => $this->t('Capitalize each word'), ), '#default_value' => $this->options['path_case'], - '#fieldset' => 'more', + '#group' => 'options][more', ); $form['transform_dash'] = array( '#type' => 'checkbox', '#title' => $this->t('Transform spaces to dashes in URL'), '#default_value' => $this->options['transform_dash'], - '#fieldset' => 'more', + '#group' => 'options][more', ); if (!empty($this->definition['many to one'])) { @@ -124,14 +124,14 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { '#title' => $this->t('Allow multiple filter values to work together'), '#description' => $this->t('If selected, multiple instances of this filter can work together, as though multiple values were supplied to the same filter. This setting is not compatible with the "Reduce duplicates" setting.'), '#default_value' => !empty($this->options['add_table']), - '#fieldset' => 'more', + '#group' => 'options][more', ); $form['require_value'] = array( '#type' => 'checkbox', '#title' => $this->t('Do not display items with no value in summary'), '#default_value' => !empty($this->options['require_value']), - '#fieldset' => 'more', + '#group' => 'options][more', ); } @@ -141,7 +141,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { '#title' => $this->t('Allow multiple values'), '#description' => $this->t('If selected, users can enter multiple values in the form of 1+2+3 (for OR) or 1,2,3 (for AND).'), '#default_value' => !empty($this->options['break_phrase']), - '#fieldset' => 'more', + '#group' => 'options][more', ); } diff --git a/core/modules/views_ui/src/Tests/FieldUITest.php b/core/modules/views_ui/src/Tests/FieldUITest.php index ff0e382b03917ce0e4c2f3a462e1a40445e1bfeb..b6018f7f964c6a841289760b4780974abf59e656 100644 --- a/core/modules/views_ui/src/Tests/FieldUITest.php +++ b/core/modules/views_ui/src/Tests/FieldUITest.php @@ -57,6 +57,9 @@ public function testFieldUI() { $this->assertEqual((string) $result[0], '{{ age }} == Age'); $this->assertEqual((string) $result[1], '{{ id }} == ID'); $this->assertEqual((string) $result[2], '{{ name }} == Name'); + + $result = $this->xpath('//details[@id="edit-options-more"]'); + $this->assertEqual(empty($result), true, "Container 'more' is empty and should not be displayed."); } /**