From 2fc599c0893620c395ca0492c9d9e3c860c8f951 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 31 Oct 2018 13:48:47 -0300 Subject: [PATCH] Bug 21526: Fix search result pages (url vs uri vs raw) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit query_cgi is uri_escaped from the pl, so we should displayed as raw Test plan: Use wide characters ❤ Search, filter, facets, search history, rss (both interfaces) Please test deeply! Signed-off-by: Chris Cormack Signed-off-by: Marcel de Rooy Signed-off-by: Tomas Cohen Arazi --- .../intranet-tmpl/prog/en/includes/facets.inc | 13 ++++++----- .../prog/en/modules/catalogue/results.tt | 2 +- .../en/modules/catalogue/search-history.tt | 8 +++---- .../bootstrap/en/includes/opac-facets.inc | 12 +++++----- .../bootstrap/en/modules/opac-detail.tt | 2 +- .../bootstrap/en/modules/opac-opensearch.tt | 23 ++++++++++--------- .../en/modules/opac-results-grouped.tt | 3 +-- .../bootstrap/en/modules/opac-results.tt | 4 ++-- 8 files changed, 34 insertions(+), 33 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc index 204d11a366..4d2e34d1dc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc @@ -1,3 +1,4 @@ +[% USE raw %] [% USE AuthorisedValues %] [% IF ( opacfacets ) %] [% IF ( facets_loop ) %] @@ -25,18 +26,18 @@
    [% SET url = "/cgi-bin/koha/catalogue/search.pl?" _ query_cgi _ limit_cgi %] [% IF ( sort_by ) %] - [% url = BLOCK %][% url | html %][% "&sort_by=" _ sort_by |url %][% END %] + [% url = BLOCK %][% url | $raw %][% "&sort_by=" _ sort_by | url %][% END %] [% END %] [% FOREACH facet IN facets_loo.facets %] [% IF facets_loo.type_label_CollectionCodes %][% SET facet.facet_label_value = AuthorisedValues.GetByCode('CCODE',facet.facet_label_value,0) || facet.facet_label_value %][% END %]
  • [% IF facet.active %] - [% SET local_url = url _ "&nolimit=" _ facet.type_link_value _ ":" _ facet.facet_link_value %] + [% local_url = BLOCK %][% url | $raw %][% "&nolimit=" _ facet.type_link_value _ ":" _ facet.facet_link_value | url %][% END %] [% facet.facet_label_value | html %] - [x] + [x] [% ELSE %] - [% SET local_url = url _ "&limit=" _ facet.type_link_value _ ":" _ facet.facet_link_value %] - [% facet.facet_label_value | html %] + [% local_url = BLOCK %][% url | $raw %][% "&limit=" _ facet.type_link_value _ ":" _ facet.facet_link_value | url %][% END %] + [% facet.facet_label_value | html %] [% IF ( displayFacetCount ) %] ([% facet.facet_count | html %]) [% END %] @@ -45,7 +46,7 @@ [% END %] [% IF ( facets_loo.expandable ) %]
  • - Show more + Show more
  • [% END %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt index 86ae22412b..fb470a1293 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt @@ -600,7 +600,7 @@ [% IF ( outer_sup_results_loo.inner_sup_results_loop ) %] [% outer_sup_results_loo.servername | html %] [% FOREACH inner_sup_results_loo IN outer_sup_results_loo.inner_sup_results_loop %] -
[% inner_sup_results_loo.title | html %]
+
[% inner_sup_results_loo.title | html %]
[% END %] [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/search-history.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/search-history.tt index 34111a2042..8d8688cbaa 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/search-history.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/search-history.tt @@ -57,7 +57,7 @@ [% s.time |$KohaDates with_hours => 1 | html %] - [% s.query_desc | html %] + [% s.query_desc | html %] [% s.total | html %] [% END %] @@ -94,7 +94,7 @@ [% s.time |$KohaDates with_hours => 1 | html %] - [% s.query_desc | html %] + [% s.query_desc | html %] [% s.total | html %] [% END %] @@ -137,7 +137,7 @@ [% s.time |$KohaDates with_hours => 1 | html %] - [% s.query_desc | html %] + [% s.query_desc | html %] [% s.total | html %] [% END %] @@ -174,7 +174,7 @@ [% s.time |$KohaDates with_hours => 1 | html %] - [% s.query_desc | html %] + [% s.query_desc | html %] [% s.total | html %] [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc index e770bb7e16..6102b54474 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc @@ -35,18 +35,18 @@
    [% SET url = "/cgi-bin/koha/opac-search.pl?" _ query_cgi _ limit_cgi %] [% IF ( sort_by ) %] - [% url = BLOCK %][% url | html %][% "&sort_by=" _ sort_by |url %][% END %] + [% url = BLOCK %][% url | $raw %][% "&sort_by=" _ sort_by | url %][% END %] [% END %] [% FOREACH facet IN facets_loo.facets %] [% IF facets_loo.type_label_CollectionCodes %][% SET facet.facet_label_value = AuthorisedValues.GetByCode('CCODE',facet.facet_label_value,1) || facet.facet_label_value %][% END %]
  • [% IF facet.active %] - [% SET local_url = url _ "&nolimit=" _ facet.type_link_value _ ":" _ facet.facet_link_value %] + [% local_url = BLOCK %][% url | $raw %][% "&nolimit=" _ facet.type_link_value _ ":" _ facet.facet_link_value | url %][% END %] [% facet.facet_label_value | html %] - [x] + [x] [% ELSE %] - [% SET local_url = url _ "&limit=" _ facet.type_link_value _ ":" _ facet.facet_link_value %] - [% facet.facet_label_value | html %] + [% local_url = BLOCK %][% url | $raw %][% "&limit=" _ facet.type_link_value _ ":" _ facet.facet_link_value | url %][% END %] + [% facet.facet_label_value | html %] [% IF ( displayFacetCount ) %] ([% facet.facet_count | html %]) [% END %] @@ -55,7 +55,7 @@ [% END %] [% IF ( facets_loo.expandable ) %]
  • - Show more + Show more
  • [% END %]
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt index 30c59693cd..afb8f9aa58 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -1088,7 +1088,7 @@ [% END %] [%# busc is already URI encoded %] -
  • Back to results
  • +
  • Back to results
  • [% IF ( nextBiblionumber ) %] Next diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-opensearch.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-opensearch.tt index 7abdee6a13..b91b6b7a99 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-opensearch.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-opensearch.tt @@ -1,4 +1,5 @@ +[% USE raw %] [% USE Koha %] [% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %] [% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %] @@ -22,8 +23,8 @@ xmlns:atom="http://www.w3.org/2005/Atom"> <![CDATA[[% LibraryName | html %] Search [% IF ( query_desc ) %]for '[% query_desc | html %]'[% END %][% IF ( limit_desc ) %] with limit(s): '[% limit_desc | html %]'[% END %]]]> - [% OPACBaseURL | html %]/cgi-bin/koha/opac-search.pl?[% query_cgi | html %][% limit_cgi | html %]&format=rss2 - + [% OPACBaseURL | html %]/cgi-bin/koha/opac-search.pl?[% query_cgi | $raw %][% limit_cgi | url %]&format=rss2 + [% total | html %] [% offset | html %] @@ -33,7 +34,7 @@ 20 [% END %] [% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %] -