To replicate: 1/ Go to Tools > Calendar 2/ Click on a date 3/ Enter a title with text enclosed in double quotes "like this". 4/ Click Save This will cause a JavaScript error that prevents the calendar from displaying: holidays.pl?branch=CPL&calendardate=2017-05-01:382 Uncaught SyntaxError: Unexpected identifier Here's an example of the code that's erroring out: holidays["2017/5/1"] = {title:"This will cause "failure". ", description:"asdf"}; The problem is that the quotes are not escaped.
Marking importance as major, because the bug creates an error that the user can't recover from.
*** Bug 15271 has been marked as a duplicate of this bug. ***
Created attachment 63946 [details] Anomaly result of following replication steps Barton, I'm not sure if this would fall under this bug or a new bug, but when following your instructions to replicate I actually experienced a completely different result. I'm using Kohadevbox with a Debian 8 host. I followed the same procedure using both Google Chrome and Mozilla Firefox with the same result on both browsers. What's happening for me is instead of a Javascript error, what I'm getting is literally an empty screen (see attachment). The empty screen ONLY occurs by putting double quotes around the title text.
Also of note, using single quotes 'like this' does NOT cause the bug to occur. Single quotes result in expected behavior.
(In reply to Lee Jamison from comment #3) > Created attachment 63946 [details] > Anomaly result of following replication steps > > Barton, I'm not sure if this would fall under this bug or a new bug, but > when following your instructions to replicate I actually experienced a > completely different result. I'm using Kohadevbox with a Debian 8 host. I > followed the same procedure using both Google Chrome and Mozilla Firefox > with the same result on both browsers. > > What's happening for me is instead of a Javascript error, what I'm getting > is literally an empty screen (see attachment). The empty screen ONLY occurs > by putting double quotes around the title text. I get such empty screen with at least one of title or text columns having quotes.
Created attachment 63949 [details] Clarification of replication steps -- screenshot 1
Created attachment 63950 [details] Clarification of replication steps -- screenshot 2
Created attachment 63951 [details] Clarification of replication steps -- screenshot 3 I wasn't clear in my description -- Lee's screenshot shows exactly what I saw on the screen when I added double quotes to one of the text fields. I saw the JavaScript error when I launched Chrome developer tools, as shown in my attached screenshots.
Created attachment 63952 [details] [review] Fix calendar error with double quotes in title or description of holiday This patch fixes the calendar display with holidays having double qoutes in title or description. To test: - Apply patch - Go to Home > Tools > Calendar - Create new holidays of each type (Day only, repeated wekly/yearly, range, yearly repeated range and enter double qoutes in their titles and descriptions - Verify that calendar displays and works as expected - Verify that you can edit the holidays
Created attachment 63961 [details] [review] Attachment to Bug 18689 - Fix calendar error with double quotes in title or description of holiday Fix calendar error with double quotes in title or description of holiday This patch fixes the calendar display with holidays having double qoutes in title or description. To test: - Apply patch - Go to Home > Tools > Calendar - Create new holidays of each type (Day only, repeated wekly/yearly, range, yearly repeated range and enter double qoutes in their titles and descriptions - Verify that calendar displays and works as expected - Verify that you can edit the holidays https://bugs.koha-community.org/show_bug.cgi?id=18689 Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Created attachment 64143 [details] [review] Bug 18689: calendar error with double quotes in title or description of holiday This patch fixes the calendar display with holidays having double qoutes in title or description. To test: - Apply patch - Go to Home > Tools > Calendar - Create new holidays of each type (Day only, repeated wekly/yearly, range, yearly repeated range and enter double qoutes in their titles and descriptions - Verify that calendar displays and works as expected - Verify that you can edit the holidays Signed-off-by: Lee Jamison <ldjamison@marywood.edu> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Pushed to master for 17.11, thanks to everybody involved!
Pushed to 17.05.x, will be in 17.05.01
This patch has been pushed to 16.11.x and will be in 16.11.09.
Pushed to 16.05.x, for 16.05.15 release