Bug 17074: Follow-up: fixing encoding issues with multiple search terms
authorKatrin Fischer <Katrin.Fischer.83@web.de>
Sun, 7 Aug 2016 23:15:23 +0000 (01:15 +0200)
committerKyle M Hall <kyle@bywatersolutions.com>
Wed, 10 Aug 2016 13:38:17 +0000 (13:38 +0000)
If there was more than one search term you could see that that it
was url encoded. Also problems with search terms with umlauts and
other diacritics.

Patch should fix that.

https://bugs.koha-community.org/show_bug.cgi?id=17074
Signed-off-by: Marc <veron@veron.ch>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

catalogue/search.pl
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt

index 41f67aa..77c982d 100755 (executable)
@@ -504,7 +504,7 @@ for my $this_cgi ( split('&',$query_cgi) ) {
         $scan_index_to_use = $input_value; # unless $scan_index_to_use;
     }
     if ($input_name eq 'q') {
-        $scan_search_term_to_use = $input_value;
+        $scan_search_term_to_use = Encode::decode_utf8( uri_unescape( $input_value ));
     }
 }
 $template->param ( QUERY_INPUTS => \@query_inputs,
index f04876e..3cecf8a 100644 (file)
@@ -422,7 +422,7 @@ var holdForPatron = function () {
                 <tr>
                     <td>
                         [% IF ( scan_search_term_to_use ) %]
-                            Scan Index for: <input type="text" name="q" id="scan-index" size="35" value="[% scan_search_term_to_use %]" />
+                            Scan Index for: <input type="text" name="q" id="scan-index" size="35" value="[% scan_search_term_to_use | html %]" />
                         [% ELSE %]
                             Scan Index for: <input type="text" name="q" id="scan-index" size="35" value="" />
                         [% END %]