Bugzilla – Attachment 78991 Details for
Bug 21257
Patrons checkout table throws JS error when location/collection not defined
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21257: (bug 13618 follow-up) Handle undef values in JS before escapeHtml call
Bug-21257-bug-13618-follow-up-Handle-undef-values-.patch (text/plain), 3.12 KB, created by
Chris Cormack
on 2018-09-16 19:01:05 UTC
(
hide
)
Description:
Bug 21257: (bug 13618 follow-up) Handle undef values in JS before escapeHtml call
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2018-09-16 19:01:05 UTC
Size:
3.12 KB
patch
obsolete
>From 340d4c77172e6deb3f72be154ff0518102aa6154 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 24 Aug 2018 16:22:20 -0300 >Subject: [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> > >Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org> >Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> >--- > koha-tmpl/intranet-tmpl/prog/js/checkouts.js | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >index 2525f567c7..b964a9cd8f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >@@ -297,12 +297,12 @@ $(document).ready(function() { > }, > { > "mDataProp": function ( oObj ) { >- return oObj.collection.escapeHtml(); >+ return ( oObj.collection ? oObj.collection.escapeHtml() : '' ); > } > }, > { > "mDataProp": function ( oObj ) { >- return oObj.location.escapeHtml(); >+ return ( oObj.location ? oObj.location.escapeHtml() : '' ); > } > }, > { >@@ -318,7 +318,7 @@ $(document).ready(function() { > }, > { > "mDataProp": function ( oObj ) { >- return oObj.itemcallnumber.escapeHtml(); >+ return ( oObj.itemcallnumber ? oObj.itemcallnumber.escapeHtml() : '' ); > } > }, > { >@@ -638,12 +638,12 @@ $(document).ready(function() { > }, > { > "mDataProp": function ( oObj ) { >- return oObj.collection.escapeHtml(); >+ return ( oObj.collection ? oObj.collection.escapeHtml() : '' ); > } > }, > { > "mDataProp": function ( oObj ) { >- return oObj.location.escapeHtml(); >+ return ( oObj.location ? oObj.location.escapeHtml() : '' ); > } > }, > { "mDataProp": "issuedate_formatted" }, >@@ -654,7 +654,7 @@ $(document).ready(function() { > }, > { > "mDataProp": function ( oObj ) { >- return oObj.itemcallnumber.escapeHtml(); >+ return ( oObj.itemcallnumber ? oObj.itemcallnumber.escapeHtml() : '' ); > } > }, > { >-- >2.11.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 21257
:
78086
|
78145
|
78156
|
78173
|
78174
|
78849
|
78973
| 78991