Unverified Commit d467e8de authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2957336 by mstrelan, hughworm, quietone, smustgrave: Invalid exposed form data not excluded

(cherry picked from commit 084ce88e)
parent ee24f8d2
Loading
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -196,7 +196,6 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
    $view->exposed_data = $values;
    $view->exposed_raw_input = [];

    $exclude = ['submit', 'form_build_id', 'form_id', 'form_token', 'exposed_form_plugin', 'reset'];
    /** @var \Drupal\views\Plugin\views\exposed_form\ExposedFormPluginBase $exposed_form_plugin */
    $exposed_form_plugin = $view->display_handler->getPlugin('exposed_form');
    $exposed_form_plugin->exposedFormSubmit($form, $form_state, $exclude);
+3 −2
Original line number Diff line number Diff line
@@ -137,12 +137,13 @@ public function testExposedFormRawInput(): void {
    $view->save();
    $this->executeView($view);

    // The "type" filter should be excluded from the raw input because its
    // value is "All".
    $expected = [
      'type' => 'All',
      'type_with_default_value' => 'article',
      'multiple_types_with_default_value' => ['article' => 'article'],
    ];
    $this->assertSame($view->exposed_raw_input, $expected);
    $this->assertSame($expected, $view->exposed_raw_input);
  }

}