Bugzilla – Attachment 119166 Details for
Bug 27748
Encoding problem in link to OverDrive results
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27748: Encoding problem in link to OverDrive results
Bug-27748-Encoding-problem-in-link-to-OverDrive-re.patch (text/plain), 3.40 KB, created by
Katrin Fischer
on 2021-04-03 22:14:19 UTC
(
hide
)
Description:
Bug 27748: Encoding problem in link to OverDrive results
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2021-04-03 22:14:19 UTC
Size:
3.40 KB
patch
obsolete
>From 73cc1418fa4dad0031de0a3699077fbd28c44d38 Mon Sep 17 00:00:00 2001 >From: Magnus Enger <magnus@libriotech.no> >Date: Tue, 23 Feb 2021 10:39:33 +0100 >Subject: [PATCH] Bug 27748: Encoding problem in link to OverDrive results >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >If you have OverDrive enabled and do a search for e.g. "Göteborg", >you will get a link above the regular Koha search results that >says e.g. "Found 1 results in the library's OverDrive collection". >If you follow this link, a search will be made in OverDrive, but only >for "G", because the search term is cut off at the first non-ASCII >char. > >To test: >- Make sure OverDrive is enabled >- Do a search that contains a non-ASCII char, like "Göteborg" >- Click on the link "Found x results in the library's OverDrive > collection" >- Verify the query string is cut off at the first non-ASCII char, > and that the number of hits is different from the number given > in the link on the previous page >- Apply the patch, restart all the things >- Repeat the search, and verify that the numbers match and that the > query string is intact after clicking on the OverDrive link > >Lookin at the code, the same problem seems to be shared between >OverDrive and RecordedBooks. I have applied the same fix to both, >but I do not have access to RecordedBooks, so I have not been able >to verify that the problem exists there and is fixed by my patch. > >Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >index 7f7ead964a..ad6c7eed7d 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >@@ -934,7 +934,7 @@ > } > > if ( data.totalItems ) { >- $overdrive_results.html( '<a href="/cgi-bin/koha/opac-overdrive-search.pl?q=' + escape( od_querystring ) + '">' + MSG_RESULTS_FOUND_IN_COLLECTION.format(data.totalItems, 'OverDrive') + '</a>' ); >+ $overdrive_results.html( '<a href="/cgi-bin/koha/opac-overdrive-search.pl?q=' + encodeURIComponent( od_querystring ) + '">' + MSG_RESULTS_FOUND_IN_COLLECTION.format(data.totalItems, 'OverDrive') + '</a>' ); > } else { > $overdrive_results.remove(); > } >@@ -952,7 +952,7 @@ > > // data.total can be either 42 or "60+" > if ( typeof(data.total) === 'string' && data.total.charAt(0) > 0 || typeof(data.total) === 'number' && data.total > 0 ) { >- $recordedbooks_results.html( '<a href="/cgi-bin/koha/opac-recordedbooks-search.pl?q=' + escape( querystring ) + '">' + MSG_RESULTS_FOUND_IN_COLLECTION.format(data.total, 'RecordedBooks') + '</a>' ); >+ $recordedbooks_results.html( '<a href="/cgi-bin/koha/opac-recordedbooks-search.pl?q=' + encodeURIComponent( querystring ) + '">' + MSG_RESULTS_FOUND_IN_COLLECTION.format(data.total, 'RecordedBooks') + '</a>' ); > } else { > $recordedbooks_results.remove(); > } >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 27748
:
117194
|
118481
| 119166