LP#1549505: fix handling of OPAC sort CGI parameter
authorGalen Charlton <gmc@esilibrary.com>
Thu, 10 Mar 2016 20:55:57 +0000 (15:55 -0500)
committerGalen Charlton <gmc@esilibrary.com>
Thu, 10 Mar 2016 20:55:57 +0000 (15:55 -0500)
This patch ensures that the 'sort' parameter does not
get duplicate when a global default sort order is set
and a user switches from that to relevance to another
order.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Open-ILS/src/templates/opac/parts/searchbar.tt2

index 64cae0d..3c93b42 100644 (file)
         [% END %]
     </div>
     [%- END %]
-    [% IF NOT CGI.param('sort') %]
+    [% IF NOT CGI.param('sort').defined AND ctx.default_sort %]
     <input type="hidden" name="sort" value="[% ctx.default_sort %]"/>
     [% END %]
     [% UNLESS took_care_of_form %]</form>[% END %]