LP#1549505: avoid doubling of the 'sort' CGI parameter
authorGalen Charlton <gmc@esilibrary.com>
Tue, 22 Mar 2016 17:45:58 +0000 (13:45 -0400)
committerGalen Charlton <gmc@esilibrary.com>
Tue, 22 Mar 2016 17:45:58 +0000 (13:45 -0400)
This patch ensures that the hidden input to set
the default sort value doesn't get applied to the results
page, which already supplied a widget for the purpose.

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

index 3c93b42..53ee4bc 100644 (file)
         [% END %]
     </div>
     [%- END %]
-    [% IF NOT CGI.param('sort').defined AND ctx.default_sort %]
-    <input type="hidden" name="sort" value="[% ctx.default_sort %]"/>
+    [% UNLESS took_care_of_form %]
+        [% IF NOT CGI.param('sort').defined AND ctx.default_sort %]
+            <input type="hidden" name="sort" value="[% ctx.default_sort %]"/>
+        [% END %]
+        </form>
     [% END %]
-    [% UNLESS took_care_of_form %]</form>[% END %]
     [% IF (is_advanced AND NOT is_special) AND CGI.param('qtype') %]
     <div class="opac-auto-102">
         [ <a href="[% mkurl(ctx.opac_root _ '/advanced') %]" rel="nofollow" vocab="">[%