Bug 11277: fix errors with search facet links in Bootstrap theme
authorFrédéric Demians <f.demians@tamil.fr>
Tue, 26 Nov 2013 09:16:41 +0000 (10:16 +0100)
committerGalen Charlton <gmc@esilibrary.com>
Sun, 15 Dec 2013 18:55:39 +0000 (18:55 +0000)
This patch fixes the following rwo errors:

  1. When selecting 'show more' above a facet, the advanced search page
     is displayed.
  2. When restricting search on a library facet, all the biblio records
     of this library are returned.

The patch fixes the way URL are encoded with TT filter. See:

http://search.cpan.org/~abw/Template-Toolkit-2.25/lib/Template/Manual/Filters.pod#url

Signed-off-by: Liz Rea <liz@catalyst.net.nz>

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Patch works nicely. Tests done:
- 'More' link on facets redirects to advanced search before applying
  the patch. After appyling the link works correctly.
- In my tests, the facet links themselves worked nicely, limiting the
  search as expected.
- Availability search works ok for me with patch applied.
- Also made sure to click on some links containing diacritcts (German
  umlauts).

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc

index dabb207..5669ce1 100644 (file)
@@ -6,9 +6,9 @@
                 <ul>
                     <li>
                         [% IF ( available ) %]
-                            Showing only <strong>available</strong> items. <a href="/cgi-bin/koha/opac-search.pl?[% query_cgi |uri %][% limit_cgi_not_availablity %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by |uri %][% END %]">Show all items</a>
+                            Showing only <strong>available</strong> items. <a href="/cgi-bin/koha/opac-search.pl?[% query_cgi |url %][% limit_cgi_not_availablity %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by |url %][% END %]">Show all items</a>
                         [% ELSE %]
-                            <a href="/cgi-bin/koha/opac-search.pl?[% query_cgi |uri %][% limit_cgi |uri %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by |uri %][% END %]&amp;limit=available">Limit to currently available items.</a>
+                            <a href="/cgi-bin/koha/opac-search.pl?[% query_cgi |url %][% limit_cgi |url %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by |url %][% END %]&amp;limit=available">Limit to currently available items.</a>
                         [% END %]
                     </li>
                 </ul>
@@ -31,7 +31,7 @@
                         <ul>
                             [% FOREACH facet IN facets_loo.facets %]
                                 <li>
-                                    <a href="/cgi-bin/koha/opac-search.pl?[% query_cgi |uri %][% limit_cgi |uri %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by |uri %][% END %]&amp;limit=[% facet.type_link_value |uri %]:[% facet.facet_link_value |uri %]" title="[% facet.facet_title_value |html %]">[% facet.facet_label_value %]</a>
+                                    <a href="/cgi-bin/koha/opac-search.pl?[% query_cgi |url %][% limit_cgi |url %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by |url %][% END %]&amp;limit=[% facet.type_link_value |url %]:[% facet.facet_link_value |url %]" title="[% facet.facet_title_value |html %]">[% facet.facet_label_value %]</a>
                                     [% IF ( displayFacetCount ) %]
                                         ([% facet.facet_count %])
                                     [% END %]
@@ -39,8 +39,8 @@
                             [% END %]
                             [% IF ( facets_loo.expandable ) %]
                                 <li class="showmore">
-                                    <a href="/cgi-bin/koha/opac-search.pl?[% query_cgi |uri %][% limit_cgi |uri %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by |uri %][% END %][% IF ( offset ) %]
-                                            &amp;offset=[% offset |uri %][% END %]&amp;expand=[% facets_loo.expand |uri %]#[% facets_loo.type_id |uri %]">Show more</a>
+                                    <a href="/cgi-bin/koha/opac-search.pl?[% query_cgi |url %][% limit_cgi |url %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by |url %][% END %][% IF ( offset ) %]
+                                            &amp;offset=[% offset |url %][% END %]&amp;expand=[% facets_loo.expand |url %]#[% facets_loo.type_id |url %]">Show more</a>
                                 </li>
                             [% END %]
                         </ul>