"Between" filters cannot be made collapsible

Created on 15 May 2025, about 2 months ago

Problem/Motivation

A filter with operator "between" is not made collapsible when that option is chosen.

Steps to reproduce

  • Add a date filter to a view with operator "between".
  • Mark that filter as collapsible in the exposed form settings.
  • Observe that when the filter is rendered, it is still not collapsible.

Proposed resolution

My original filter's key is date. In FilterWidgetBase::exposedFormAlter(), it's checking if $form['date'] exists before adding the details element. But I find that my $form['date'] filter has already been replaced with $form['date_wrapper'] before this method runs, so that check fails and the details element is never added. This part of the code is immediately followed by some logic to handle _wrapper keys, so perhaps that logic needs to be changed and/or moved higher in the file?

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

7.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States Lanny Heidbreder

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Lanny Heidbreder
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Just tested by adding a date field and choosing between, make collapsible seems to be working just fine. Could use additional info.

  • πŸ‡¨πŸ‡¦Canada man-1982

    I have the same issue:
    made a couple screenshots as a proof

    It's appear into 7.0.5

    the 7.0.4 does not have the issue

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Not going to ping pong it but not able to replicate this one.

    Need clear steps from a fresh d11 install

  • πŸ‡¨πŸ‡¦Canada man-1982

    Actually, it a good call.
    I mean about D11.
    I can reproduce it on D10, but never tried on D11.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    And I don't know if it should matter but see you are using gin, I tested with claro and olivero

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    just following up in a fresh install if you are seeing the issue?

    Pipeline runs against 10.x and seems to pass there as well.

  • πŸ‡¨πŸ‡¦Canada man-1982

    The report:
    I've used DDEV addon for doing Drupal core development https://github.com/justafish/ddev-drupal-core-dev

    Drupal core 10.4.7-dev

    Better Exposed Filters 7.0.5

    Claro 10.4.7-dev as an administration theme.

    Umami 10.4.7-dev as an default theme.

    Steps to reproduce:

    1 . Create a views for the any node type
    2 . Add Changed to the filter createria.
    3. Expose this filter
    4. Operator should be "is Between"
    5. in the "Exposed form" section Exposed form style: Better Exposed Filters
    6. in the Advanced filter option set up "Make filter options collapsible"
    7. Apply and Save
    The expectations:
    it should be collapsible and based on details html tag
    instead we can see fieldset tag.

    fieldset β†’

    the Exposed form settings:

  • πŸ‡¨πŸ‡¦Canada man-1982

    continue...
    the result under Umami 10.4.7-dev (default theme)

    another observations:

    if switch it to another Operator (not between) It works as expected.


    @smustgrave please have a look to the report, look forward to your opinion

  • πŸ‡ΊπŸ‡ΈUnited States zaurav McLean, VA

    I'm having the same issue. Cannot collapse or move it into secondary options if the Date filter is an 'in between'. If the Date filter is single field (less than), it works fine.

  • πŸ‡¨πŸ‡¦Canada man-1982

    @smustgrave We have two confirmed cases.
    changed status to Needs work.
    Thanks

Production build 0.71.5 2024