[Bug 14327] New: Fix js error "TypeError: events is null" in additem.js
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14327 Bug ID: 14327 Summary: Fix js error "TypeError: events is null" in additem.js Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: Cataloging Assignee: gmcharlt@gmail.com Reporter: m.de.rooy@rijksmuseum.nl QA Contact: testopia@bugs.koha-community.org CC: m.de.rooy@rijksmuseum.nl As reported by Jonathan on report 10480: I found a bug: 1/ Open the console 2/ Go on the new order page 3/ TypeError: events is null for(i=0; i<events.length; i++) { additem.js (ligne 176, col. 13) I suppose it happens when none of the fields use a plugin. Patch forthcoming. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14327 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|gmcharlt@gmail.com |m.de.rooy@rijksmuseum.nl Patch complexity|--- |Trivial patch Status|NEW |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14327 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14327 --- Comment #1 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 39832 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=39832&action=edit 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. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14327 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@biblibre.co | |m -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14327 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=10480 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14327 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14327 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #39832|0 |1 is obsolete| | --- Comment #2 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 39834 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=39834&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14327 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14327 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #39834|0 |1 is obsolete| | --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 39943 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=39943&action=edit [PASSED QA] 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> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14327 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |tomascohen@gmail.com --- Comment #4 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Patch pushed to master. Thanks Marcel! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14327 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable CC| |chris@bigballofwax.co.nz --- Comment #5 from Chris Cormack <chris@bigballofwax.co.nz> --- Pushed to 3.20.x will be in 3.20.1 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14327 Liz Rea <wizzyrea@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wizzyrea@gmail.com --- Comment #6 from Liz Rea <wizzyrea@gmail.com> --- Patch pushed to 3.18.x will be in 3.18.08 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14327 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mtj@kohaaloha.com --- Comment #7 from Mason James <mtj@kohaaloha.com> --- Patch not applicable for 3.16.x series -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org