Bugzilla – Attachment 173250 Details for
Bug 38248
Staff interface detail page item table lookup fails when item has lost status but no claims returned
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38248: Fix condition when item has no return_claims in API response
Bug-38248-Fix-condition-when-item-has-no-returncla.patch (text/plain), 2.45 KB, created by
Phil Ringnalda
on 2024-10-24 05:29:57 UTC
(
hide
)
Description:
Bug 38248: Fix condition when item has no return_claims in API response
Filename:
MIME Type:
Creator:
Phil Ringnalda
Created:
2024-10-24 05:29:57 UTC
Size:
2.45 KB
patch
obsolete
>From 5e825df179bb5e0b9d6d5790890aedcd44f6fdb8 Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Wed, 23 Oct 2024 22:35:00 +0000 >Subject: [PATCH] Bug 38248: Fix condition when item has no return_claims in > API response > >This change just fixes a condition to not break when an item has no return_claims >in an API response. > >Test plan: >0) Apply the patch and koha-plack --restart kohadev >NOTE: You may need to rebuild your swagger spec since bug 27919 was pushed >redocly bundle --ext json api/v1/swagger/swagger.yaml \ > --output api/v1/swagger/swagger_bundle.json >1) Go to http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=29 >2) Create an item with a status of "Lost" >3) Go to http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=29 >4) Note that the item table loads without a problem > >5) In system preferences, set the ClaimReturnedLostValue syspref to any value >6) Checkout an item to a patron >7) Click "Claim returned" and make the claim >8) Go to http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=29 >9) Note that the item table loads without a problem and "(Claimed returned") appears >for the item that was claimed returned > >Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> >--- > .../en/includes/html_helpers/tables/items/catalogue_detail.inc | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc >index 0f15e19a52..f887662f0a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc >@@ -494,7 +494,7 @@ > > if ( row.lost_status ) { > let lost_lib = av_lost.get(row.lost_status.toString()) || _("Unavailable (lost or missing"); >- const hasReturnClaims = row.return_claims.filter(rc => !rc.resolution).length > 0 ? true : false >+ const hasReturnClaims = row.return_claims && row.return_claims.filter(rc => !rc.resolution).length > 0 ? true : false > nodes += '<span class="lost">%s</span>'.format(escape_str(lost_lib)); > if(hasReturnClaims) { > nodes += '<span class="claimed_returned">' + _("(Claimed returned)") + '</span>'; >-- >2.44.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 38248
:
173241
| 173250 |
173704
|
173708