Bugzilla – Attachment 182269 Details for
Bug 32266
Make the late orders page render using the API
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32266: (follow-up) Handle null basket.authorizer gracefully
Bug-32266-follow-up-Handle-null-basketauthorizer-g.patch (text/plain), 2.25 KB, created by
Tomás Cohen Arazi (tcohen)
on 2025-05-12 12:59:11 UTC
(
hide
)
Description:
Bug 32266: (follow-up) Handle null basket.authorizer gracefully
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2025-05-12 12:59:11 UTC
Size:
2.25 KB
patch
obsolete
>From b4c9e58cbeda6b9ec2477e3e3916238400d97738 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 12 May 2025 09:54:38 -0300 >Subject: [PATCH] Bug 32266: (follow-up) Handle null basket.authorizer > gracefully > >This patch makes the JS code handle the situation of >`aqbasket.authorisedby` being NULL. > >I was only able to reproduce this by manually touching the DB, but >existing data might have this situation. > >To test: >1. Have a few late orders >2. Pick a basket id >3. Run: > $ ktd --shell > k$ koha-mysql kohadev > > UPDATE aqbasket SET authorisedby=NULL WHERE basketno=2; > (in this case 2 was my chosen basket). >4. Visit the late orders page >=> FAIL: The table doesn't render correclty, the browser inspector says >something about authorizer being null >5. Apply this patch >6. Repeat 4 >=> SUCCESS: The table renders correctly, the 'Library' column has an >empty string for the affected rows >7. Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > .../intranet-tmpl/prog/en/modules/acqui/lateorders.tt | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt >index b359f7067d9..ff5694fb899 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt >@@ -398,11 +398,15 @@ > } > }, > { >- data: 'basket.authorizer.library_id', >+ data: "", // 'basket.authorizer.library_id' > orderable: false, >- searchable: false, >+ searchable: false, // FIXME: not searchable as there's no FK > render: function(data, type, row, meta) { >- return escape_str(row.basket.authorizer._strings.library_id.str); >+ if ( basket.authorizer != null ) { >+ return escape_str(row.basket.authorizer._strings.library_id.str); >+ } >+ >+ return ""; > } > }, > { >-- >2.49.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 32266
:
144145
|
144165
|
144699
|
182041
|
182042
|
182043
| 182269