Bug 15735: Audio Alerts editor broken by use of of single quotes in editor

Single quotes audio selector break ability to edit an alert

Test Plan:
1) Enable audio alerts
2) Add new a alert with a select containing single quotes such as: input[name*='test']
3) Note you cannot edit the alert
4) Apply this patch
5) Reload the page
6) You should now be able to edit the alert

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Bug 15734 applied on top. Works as advertised

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

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit f300914147)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
This commit is contained in:
Kyle M Hall 2016-02-03 19:05:19 +00:00 committed by Julian Maurice
parent b19659e304
commit ce5a03424e
2 changed files with 2 additions and 2 deletions

View File

@ -69,7 +69,7 @@
<script type="text/javascript">
//<![CDATA[
var AUDIO_ALERT_PATH = '[% interface %]/[% theme %]/sound/';
var AUDIO_ALERTS = JSON.parse( '[% AudioAlerts.AudioAlerts | replace( "'", "\\'" ) %]' );
var AUDIO_ALERTS = JSON.parse( '[% AudioAlerts.AudioAlerts | replace( "'", "\\'" ) | replace( '"', '\\"' ) %]' );
//]]>
$( document ).ready(function() {

View File

@ -157,7 +157,7 @@ function EditAlert( elt, id, precedence, selector, sound ) {
</td>
<td>[% a.selector %]</td>
<td>[% a.sound %]</td>
<td><a class="btn btn-small" onclick="EditAlert( this, '[% a.id %]','[% a.precedence %]', '[% a.selector %]', '[% a.sound %]' )" ><i class="icon-pencil"></i> Edit</a></td>
<td><a class="btn btn-small" onclick="EditAlert( this, '[% a.id %]','[% a.precedence %]', '[% a.selector | replace( "'", "\\'" ) | html %]', '[% a.sound %]' )" ><i class="icon-pencil"></i> Edit</a></td>
</tr>
[% END %]
</tbody>