All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

Low Search shortcuts params persisting after resubmitting search

James Nowland 6 Nov 2014 04:29 problem, complete

I have set up a bunch of shortcuts that have parameters similar to this:

category:product="45"

When you go to that page with the shortcut it works fine and correctly shows the shortcut category and the form with the corresponding category:product="45" checkbox as checked.



However if you toggle the (category:product="45") checkbox to the unchecked state and resubmit the form on the new search page it doesn't clear the checkbox and shows the original shortcode checkbox as "checked".

This is not an issue when we are just using the a query param to populate this search.

The workaround:
Due to using checkboxes what we ended up doing is putting a blank value in via a hidden field: . This wouldn't be an issue with a select field as it always submits a value.

While we have a working workaround - the main issue is that query and search are working in two different ways when you use checkboxes to represent and display categories.

Running:
Expression Engine: v2.7.3
Low Search: 3.2.0 - The patched version you sent to me on 2014-11-05

Note: Leevi said if you need to get access to stage site for this "problem" hit him up for the details :).

Replies

  1. Low 6 Nov 2014 08:09

    Try commenting out line #292 of mod.low_search.php, which says:

    $params = array_merge($params, $shortcut['parameters']);


    Does that help?

  2. James Nowland 9 Nov 2014 22:14

    This does fix the issue of the values not clearing on a new search!

    Is there anything else you would like tested?

    Please note the edit.

  3. Low 10 Nov 2014 07:58

    You can keep that in place for now. I've got a new parameter in place for the next version, that lets you decide whether to "remember" the shortcut without having input fields in place or not. Not setting that param will have the effect you're seeing now with that line commented out.

    So it's all working now?

  4. James Nowland 10 Nov 2014 22:11

    Yes this is all working! Just to confirm are the two patches you have provided in the last week will be rolled into an update in the near future?

  5. Low 10 Nov 2014 22:12

    Yep. I'll be releasing an update this week.