URL tag 'toggle' parameter can't remove final value
Hi there, I'm not sure if this is intended behavior, but it seems the 'toggle' parameter on a URL tag does not work if the value in question is the only value for that field. It works fine for adding and removing values up till I try to remove the last one to return to a "clean" set of results.
Code is based on the sample in the docs to generate a list of values from a specific channel that is used in Playa relationships, instead of categories as in your docs example:
{exp:low_search:filters query="{segment_3}"}
{exp:channel:entries channel="resource_types" dynamic="no" orderby="title" sort="asc" disable="categories|member_data|pagination|custom_fields"}
{if count == 1}<ul>{/if}
{exp:playa:parents channel="resources" var_prefix="pl" {stash:permissions} limit="1"}
<li>
<a href="{low_search:url result_page="dev/resourcelib2" toggle:search:resource_type="{title}"}">{title}</a>
{if title IN ({low_search_search:resource_type})}✓{/if}
</li>
{/exp:playa:parents}
{if count == total_results}</ul>{/if}
{/exp:channel:entries}
{/exp:low_search:filters}
Thank you
Edit: I also tried this with entry titles from the channel I'm searching, in case there was something weird going on with the Playa relationships. But the same behavior occurs. 'toggle' doesn't remove the last item if I am trying to basically remove the parameter from search.
Replies
Low 6 Apr 2014 11:35
What are your EE, LS and PHP versions?
CNG 6 Apr 2014 11:37
EE 2.7.2, LS 3.0.3, PHP 5.3.28
Low 6 Apr 2014 11:38
Can you first try and upgrade LS to the latest version (3.1.3) to see if the issue persists?
CNG 6 Apr 2014 11:40
I thought I had, but now I see I forgot to run module updates. Now running latest LS, and issue seems to persist.
Low 6 Apr 2014 12:09
Can you try and open up mod.low_search.php and go to line 1079, which reads:
Change that to...
...and it should work again.
CNG 6 Apr 2014 12:11
Indeed, that fixed it. Thanks!