From 0407c54824f49c6753658e79140009a4dc671966 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 30 Oct 2024 09:53:44 +0100 Subject: [PATCH] Bug 38248: Do not deal with return claims if pref is not set If the pref is not set we don't embed return_claims and so row.return_claims will never be set. When the pref is on, row.return_claims should always be an array. Test plan: Same as previous patch --- .../html_helpers/tables/items/catalogue_detail.inc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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 14b47ecf9cd..7e44c02a5a1 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,11 +494,13 @@ if ( row.lost_status ) { let lost_lib = av_lost.get(row.lost_status.toString()) || _("Unavailable (lost or missing"); - const hasReturnClaims = row.return_claims && row.return_claims.filter(rc => !rc.resolution).length > 0 ? true : false nodes += '%s'.format(escape_str(lost_lib)); - if(hasReturnClaims) { - nodes += '' + _("(Claimed returned)") + ''; - } + [% IF Koha.Preference('ClaimReturnedLostValue') %] + const hasReturnClaims = row.return_claims.filter(rc => !rc.resolution).length > 0 ? true : false + if(hasReturnClaims) { + nodes += '' + _("(Claimed returned)") + ''; + } + [% END %] } if ( row.withdrawn ) { -- 2.34.1