[Bug 21257] New: Patrons checkout table throws JS error when location/collection not defined
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21257 Bug ID: 21257 Summary: Patrons checkout table throws JS error when location/collection not defined Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: Circulation Assignee: koha-bugs@lists.koha-community.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com To recreate: 1 - Check out an item to a patron 2 - Make sure that item has no collection of location defined 3 - Try to view patrons checkouts - table does not load 4 - Check the console: TypeError: oObj.collection is null -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21257 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Depends on| |13618 Patch complexity|--- |Trivial patch Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13618 [Bug 13618] Prevent XSS in the Staff Client and the OPAC -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21257 --- Comment #1 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 78086 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=78086&action=edit Bug 21257: Return blank strings instead of null in svc/checkouts To test: 1 - Find an item with no collection or location defined 2 - Check it out to a patron 3 - Note you cannot view the checkouts table 4 - Check the console: TypeError: oObj.collection is null 5 - Apply patch 6 - Restart all the things 7 - Checkouts table should load -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21257 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org, | |nick@bywatersolutions.com Assignee|koha-bugs@lists.koha-commun |nick@bywatersolutions.com |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21257 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21257 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #78086|0 |1 is obsolete| | --- Comment #2 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 78145 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=78145&action=edit Bug 21257: Return blank strings instead of null in svc/checkouts To test: 1 - Find an item with no collection or location defined 2 - Check it out to a patron 3 - Note you cannot view the checkouts table 4 - Check the console: TypeError: oObj.collection is null 5 - Apply patch 6 - Restart all the things 7 - Checkouts table should load Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Works as expected! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21257 --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- It works but I am wondering if we should not use the same method for/as lost and damaged. So either in the controller, init the var with an empty string instead of undef, or in the js: if ( oObj.damaged ) { due += "<span class='dmg'>" + oObj.damaged.escapeHtml() + "</span>"; } VS { "mDataProp": function ( oObj ) { return oObj.location.escapeHtml(); } }, As escapeHtml does not handle undef I think we should do the check in the js instead, like: { "mDataProp": function ( oObj ) { return ( oObj.location ? oObj.location.escapeHtml() : '' ) } }, -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21257 --- Comment #4 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 78156 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=78156&action=edit [ALTERNATIVE-PATCH] Bug 21257: (bug 13618 follow-up) Handle undef values in JS before escapeHtml call To test: 1 - Find an item with no collection or location defined 2 - Check it out to a patron 3 - Note you cannot view the checkouts table 4 - Check the console: TypeError: oObj.collection is null 5 - Apply patch 6 - Restart all the things 7 - Checkouts table should load -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21257 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.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21257 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #78145|0 |1 is obsolete| | Attachment #78156|0 |1 is obsolete| | --- Comment #5 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 78173 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=78173&action=edit Bug 21257: Return blank strings instead of null in svc/checkouts To test: 1 - Find an item with no collection or location defined 2 - Check it out to a patron 3 - Note you cannot view the checkouts table 4 - Check the console: TypeError: oObj.collection is null 5 - Apply patch 6 - Restart all the things 7 - Checkouts table should load Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Works as expected! Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21257 --- Comment #6 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 78174 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=78174&action=edit Bug 21257: (bug 13618 follow-up) Handle undef values in JS before escapeHtml call To test: 1 - Find an item with no collection or location defined 2 - Check it out to a patron 3 - Note you cannot view the checkouts table 4 - Check the console: TypeError: oObj.collection is null 5 - Apply patch 6 - Restart all the things 7 - Checkouts table should load Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21257 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #7 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Is the second really an alternative patch? Because with only the second patch the checkouts table still won't load. Both together work well. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21257 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |In Discussion --- Comment #8 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Katrin Fischer from comment #7)
Is the second really an alternative patch? Because with only the second patch the checkouts table still won't load. Both together work well.
Yes, only second patch should be needed. Which JS error do you get? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21257 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|nick@bywatersolutions.com |jonathan.druart@bugs.koha-c | |ommunity.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21257 --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- With only the second patch applied, I still get: TypeError: oObj.collection is null -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21257 --- Comment #10 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Updating to master, there is still no check in place for linking subscriptions to non-existing biblionumbers. I think this should be checked on saving or maybe even when moving from the first part of the subscription form to the second. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21257 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #78174|0 |1 is obsolete| | --- Comment #11 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 78849 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=78849&action=edit [ALTERNATIVE-PATCH] Bug 21257: (bug 13618 follow-up) Handle undef values in JS before escapeHtml call To test: 1 - Find an item with no collection or location defined 2 - Check it out to a patron 3 - Note you cannot view the checkouts table 4 - Check the console: TypeError: oObj.collection is null 5 - Apply patch 6 - Restart all the things 7 - Checkouts table should load Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21257 --- Comment #12 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Katrin Fischer from comment #9)
With only the second patch applied, I still get: TypeError: oObj.collection is null
Can you try again with the last patch only please? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21257 Christopher Brannon <cbrannon@cdalibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |cbrannon@cdalibrary.org --- Comment #13 from Christopher Brannon <cbrannon@cdalibrary.org> --- I tried last patch and it failed. Needed to refresh screen. :/ -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21257 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|In Discussion |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21257 Christopher Brannon <cbrannon@cdalibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21257 Christopher Brannon <cbrannon@cdalibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #78173|0 |1 is obsolete| | --- Comment #14 from Christopher Brannon <cbrannon@cdalibrary.org> --- Created attachment 78973 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=78973&action=edit Bug 21257: (bug 13618 follow-up) Handle undef values in JS before escapeHtml call To test: 1 - Find an item with no collection or location defined 2 - Check it out to a patron 3 - Note you cannot view the checkouts table 4 - Check the console: TypeError: oObj.collection is null 5 - Apply patch 6 - Restart all the things 7 - Checkouts table should load Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21257 Christopher Brannon <cbrannon@cdalibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #78849|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21257 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21257 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #78973|0 |1 is obsolete| | --- Comment #15 from Chris Cormack <chris@bigballofwax.co.nz> --- Created attachment 78991 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=78991&action=edit Bug 21257: (bug 13618 follow-up) Handle undef values in JS before escapeHtml call To test: 1 - Find an item with no collection or location defined 2 - Check it out to a patron 3 - Note you cannot view the checkouts table 4 - Check the console: TypeError: oObj.collection is null 5 - Apply patch 6 - Restart all the things 7 - Checkouts table should load Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org> Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21257 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #16 from Nick Clemens <nick@bywatersolutions.com> --- Awesome work all! Pushed to master for 18.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21257 Bug 21257 depends on bug 13618, which changed state. Bug 13618 Summary: Add additional template filter methods and a filter presence test to Koha https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13618 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21257 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Pushed to Master |RESOLVED -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org