Bugzilla – Attachment 39834 Details for
Bug 14327
Fix js error "TypeError: events is null" in additem.js
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14327: Fix js error "TypeError: events is null" in additem.js
Bug-14327-Fix-js-error-TypeError-events-is-null-in.patch (text/plain), 2.02 KB, created by
Jonathan Druart
on 2015-06-04 08:37:05 UTC
(
hide
)
Description:
Bug 14327: Fix js error "TypeError: events is null" in additem.js
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-06-04 08:37:05 UTC
Size:
2.02 KB
patch
obsolete
>From 63360eb13bad1862eef1353aab8b95624dbd5725 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 4 Jun 2015 09:15:24 +0200 >Subject: [PATCH] Bug 14327: Fix js error "TypeError: events is null" in > additem.js > >If you have no item plugins, the events variable in BindPluginEvents >of additem.js will be null. So testing events.length will generate >the described error. >This patch adds a check to prevent that from happening again. > >Test plan: >[1] Do not yet apply this patch ! >[2] Temporarily remove framework plugins from your items (in ACQ or default > framework). Probably you have to clear dateaccessioned.pl and > barcode.pl. >[3] Open js console in your browser. >[4] Go to Acquisition. Open a basket and add an order from a new empty > record. >[5] You should see js error: "TypeError: events is null" (additem.js:176) >[6] Apply this patch and reload the page (make sure that you refresh so > that the new javascript code is read). >[7] The TypeError should be gone. >[8] Restore the framework plugins from step 2. Refresh the page again and > verify that they still work as expected. > >Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org> >--- > koha-tmpl/intranet-tmpl/prog/en/js/additem.js | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/additem.js b/koha-tmpl/intranet-tmpl/prog/en/js/additem.js >index de3ee71..4a9de09 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/js/additem.js >+++ b/koha-tmpl/intranet-tmpl/prog/en/js/additem.js >@@ -171,8 +171,8 @@ function BindPluginEvents(data) { > // the events for the plugin > // when we append, this code does not get executed anymore; so we do it here > var events= data.match(/BindEventstag_\d+_subfield_._\d+/g); >- var i; >- for(i=0; i<events.length; i++) { >+ if ( events == null ) return; >+ for(var i=0; i<events.length; i++) { > window[events[i]](); > if( i<events.length-1 && events[i]==events[i+1] ) { i++; } > // normally we find the function name twice >-- >2.1.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 14327
:
39832
|
39834
|
39943