Bugzilla – Attachment 28498 Details for
Bug 12295
Javascript error when merging authorities
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 12295 - Javascript error when merging authorities
SIGNED-OFF-Bug-12295---Javascript-error-when-mergi.patch (text/plain), 2.42 KB, created by
Bernardo Gonzalez Kriegel
on 2014-05-27 19:37:44 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 12295 - Javascript error when merging authorities
Filename:
MIME Type:
Creator:
Bernardo Gonzalez Kriegel
Created:
2014-05-27 19:37:44 UTC
Size:
2.42 KB
patch
obsolete
>From 73ae434ebb1db3370dcbab06554ecfa8d97006cc Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 20 May 2014 14:58:32 -0400 >Subject: [PATCH] [SIGNED-OFF] Bug 12295 - Javascript error when merging > authorities > >Attempting to merge authorities results in the following error: >Uncaught SyntaxError: Unexpected token u authorities-home.pl:284 > showMergingInProgress authorities-home.pl:284 > (anonymous function) authorities-home.pl:297 > o jquery.js:2 > p.fireWith jquery.js:2 > e.extend.ready jquery.js:2 > c.addEventListener.B > >This appears to be an improper use of Javascript null vs undefined. >A variable can be null and defined at the same time. We should be >checking to see if the variable is defined, rather than null. > >Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >No test plan, no errors. > >Test >1. search some authorities >2. clic merge, on browser dev console pops reported error message >'Unexpected token u authorities-home.pl...' >No way to marge auths >3. with pach applied, merging works again >--- > .../prog/en/includes/authorities_js.inc | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities_js.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/authorities_js.inc >index 4981a39..cf4a072 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities_js.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/authorities_js.inc >@@ -2,7 +2,7 @@ > //<![CDATA[ > function mergeAuth(authid, summary) { > var alreadySelected = $.cookie('auth_to_merge'); >- if (alreadySelected !== null) { >+ if (alreadySelected !== undefined) { > alreadySelected = JSON.parse(alreadySelected); > $.cookie('auth_to_merge', '', { 'path': '/', 'expires': -1 }); > var refstring = ""; >@@ -18,7 +18,7 @@ function mergeAuth(authid, summary) { > > function showMergingInProgress() { > var alreadySelected = $.cookie('auth_to_merge'); >- if (alreadySelected !== null) { >+ if (alreadySelected !== undefined) { > alreadySelected = JSON.parse(alreadySelected); > $('#merge_in_progress').html(_("Merging with authority: ") + "<a href='detail.pl?authid=" + alreadySelected.authid + "'><span class='authorizedheading'>" + alreadySelected.summary + "</span> (" + alreadySelected.authid + ")</a> <a href='#' id='cancel_merge'>" + _("Cancel merge") + "</a>"); > $('#cancel_merge').click(function(event) { >-- >1.7.9.5
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 12295
:
28376
|
28498
|
28500
|
28501