• Resolved Scott Trsar

    (@scotttrsar)


    Bug when attempting to deselect filter items. Yes, plugins up-to-date, no conflicts etc…

    The criteria to reproduce this behavior is fairly specific:

    • Create an “Additional Field” filter
    • Additional field is type “checkbox”
    • Set filter display to type “checkbox”
    • Filter item must contain a space " " in it’s name. e.g. “Not deselecting”
      Example values:
      Works
      Doesn't work
      Success
      Not successful

    Problem/Issue:
    Trying to deselect a selected filter that matches the criteria above fails and remains active (field remains checked after ajax success, filter still set in URL params). Can only clear the set filter by resetting all filters.

    Expected result:
    Filter deselects and URL param is removed to match behavior of other filter types or filter items that don’t contain a space in it’s value.

    Troubleshooting:
    It looks like the issue might be related to the regex/logic or URL encoding in js function obj.removeKeyValueFromQuery():
    ~/the-events-calendar-filterbar/src/resources/js/views/filters.js

    In the meantime, I came up with a solution going a different route and leveraging template overrides to avoid the need to modify any js.
    Basically, just needed a string replace for the input value (" " w/ "+").

    Probably not the best solution, but wanted to share this issue on the public forums in case this helps anyone else experiencing this.

    Potential solution: In my case, I was able to resolve by overriding view: ~/the-events-calendar-filterbar/src/views/v2_1/components/checkbox.php on line 31
    - change: value="<?php echo esc_attr( $value ); ?>"
    + to: value="<?php echo esc_attr( str_replace( ' ', '+', $value ) ); ?>"

    …and now the filter item clears as expected. Not sure if string replacing spaces for the input values comes with any side effects, but so far so good on my end.?

    Hope to see a release containing a more solid solution addressing this bug in the near future by TEC devs.
    ??</img>

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Darian

    (@d0153)

    Hi @scotttrsar

    Thanks for reaching out.

    At this time, we have been able to reproduce the problem and have identified a potential fix. Our engineers are working on the solution, though there are some complexities, and it will take some time to craft and validate before release. Thanks for all the details. I will definitely pass it along to our devs.

    I have added your case to our internal ticket. While we don’t have an ETA at the moment, you’ll get notified once there is an update and fix.

    Best,
    Darian

    Internal Bug Ticket Reference:
    FBAR-247

    Thread Starter Scott Trsar

    (@scotttrsar)

    Saw a release go out with this fix. Assuming it’s fixed so marking resolved.
    https://theeventscalendar.com/release-notes/filter-bar/filter-bar-5-4-5/

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Filter Bar + TEC Pro] Bug deselecting “additional field” filters’ is closed to new replies.