Summary: | single quote in didyoumean | ||
---|---|---|---|
Product: | Koha | Reporter: | Fridolin Somers <fridolin.somers> |
Component: | Templates | Assignee: | Fridolin Somers <fridolin.somers> |
Status: | CLOSED FIXED | QA Contact: | Jonathan Druart <jonathan.druart> |
Severity: | normal | ||
Priority: | P5 - low | CC: | chris, jonathan.druart, kyle, mathsabypro |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Attachments: |
Proposed patch
Proposed patch Bug 9554: single quote in didyoumean Bug 9554: single quote in didyoumean [3.10.x] Bug 9554: single quote in didyoumean |
Description
Fridolin Somers
2013-02-06 13:37:10 UTC
Created attachment 15093 [details] [review] Proposed patch Created attachment 15095 [details] [review] Proposed patch Added test plan and renamed bug. Created attachment 15177 [details] [review] Bug 9554: single quote in didyoumean When using "url" or "uri" template toolkit filters, I noticed that double quotes are escaped (%22), but not single quotes. This causes sometimes a problem when URL is written in JavaScript code, in a string delimited by single quotes. This patch corrects by using double quotes for js strings. Also, adds a test for "didyoumean" feature : when feature is not activated, do not add corresponding javascript. Test plan : - activate OpacHighlightedWords syspref - activate "didyoumean" feature for OPAC - perform a search begining with a single quote (ie "'sport") => look for javascript errors (you may use firebug) Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> I'm not able to reproduce the issue. The results appear without any js errors. Could you confirm that the issue still exists? Hello It is Rennes 2 who asked this bug to be fixed... I confirm it still exists on our preprod environnment (align on master on march 12th) error in Firebug : SyntaxError: missing ) after argument list oumean').load('/cgi-bin/koha/svc/suggestion?render=stub&q=l'histoire', M. Saby QA comment: This patch fixes the issue. IMO, too many single quotes are change, I don't know if it is blocker. I let the RM to take the decision. Marked as Passed QA. Created attachment 16264 [details] [review] Bug 9554: single quote in didyoumean When using "url" or "uri" template toolkit filters, I noticed that double quotes are escaped (%22), but not single quotes. This causes sometimes a problem when URL is written in JavaScript code, in a string delimited by single quotes. This patch corrects by using double quotes for js strings. Also, adds a test for "didyoumean" feature : when feature is not activated, do not add corresponding javascript. Test plan : - activate OpacHighlightedWords syspref - activate "didyoumean" feature for OPAC - perform a search begining with a single quote (ie "'sport") => look for javascript errors (you may use firebug) Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> This patch has been pushed to master. This doesn't apply to 3.10.x, please rebase and submit if it is needed for 3.10.x Created attachment 17174 [details] [review] [3.10.x] Bug 9554: single quote in didyoumean Patch rebased for 3.10.x Pushed to 3.10.x will be in 3.10.5 |