Problem/Motivation

If you create a grouped filter that allows multiple selection and add a default, the default is ignored.

Note: it happens when you have multiple filters. Currently, if at least one filter value is added to the user input already, the rest are just being ignored.

Proposed resolution

See the patch

Remaining tasks

Add tests

User interface changes

None

API changes

None

Data model changes

None

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

larowlan created an issue. See original summary.

larowlan’s picture

patch

and adding related issue from d7 views

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

borisson_’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

I think this needs a test as well.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

kim.pepper’s picture

Issue tags: +#pnx-sprint

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Matroskeen’s picture

Version: 9.5.x-dev » 10.0.x-dev
Issue summary: View changes
Status: Needs work » Needs review
Issue tags: -Needs tests +Bug Smash Initiative
FileSize
3.52 KB
4.21 KB

The fix makes sense. Adding some extra assertions to have a failing test.

The last submitted patch, 14: 2916682-test_only.patch, failed testing. View results

Lendude’s picture

Status: Needs review » Reviewed & tested by the community

This looks great, nice test coverage.

Checked that the new settings don't make us lose existing coverage and that looks ok.

The last submitted patch, 14: 2916682-test_only.patch, failed testing. View results

The last submitted patch, 14: 2916682-test_only.patch, failed testing. View results

The last submitted patch, 14: 2916682-test_only.patch, failed testing. View results

The last submitted patch, 14: 2916682-test_only.patch, failed testing. View results

larowlan’s picture

Queued a 9.5 test, patch looks good to me

  • larowlan committed 25a2823 on 10.1.x
    Issue #2916682 by Matroskeen: Defaults not working for grouped filter...

  • larowlan committed b51c20d on 10.0.x
    Issue #2916682 by Matroskeen: Defaults not working for grouped filter...
  • larowlan committed 5370c53 on 9.4.x
    Issue #2916682 by Matroskeen: Defaults not working for grouped filter...
  • larowlan committed 40dc92f on 9.5.x
    Issue #2916682 by Matroskeen: Defaults not working for grouped filter...
larowlan’s picture

Version: 10.0.x-dev » 9.4.x-dev
Status: Reviewed & tested by the community » Fixed

Whilst I added a patch here, it was only a copy from the D7 views queue, and that was 5 years ago. So on that basis I consider myself to be eligible to commit this.

Committed to 10.1.x and backported to 10.0.x and 9.5.x

As the risk of disruption is low here, backported to 9.4.x too.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.