From 6d92e3e4ee5059455413bb4a21fb5759d7d0e905 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Tue, 21 Jan 2025 16:37:51 +0000 Subject: [PATCH] Bug 34681: Fallback to borrowernumber when there is no cardnumber To test: 1. Have StoreLastBorrower enabled to store Last Returned By. 2. Create account and leave cardnumber empty. 3. Check out and return item with that account. 4. Go to items detail page. 5. See that Last Returned By and, if return is not anonymized, Last Borrower appears blank (you can inspect the fields and see that borrower information is there but not visible). Previous borrower will similarly be blank if it is from an account with no cardnumber. 6. APPLY PATCH 7. Try the items detail page again. You should see the link for 'Last borrower' and/or 'Previous borrower' now as the borrowernumber. Signed-off-by: Magnus Enger Works as advertised, with the tiny followup I am providing. --- .../intranet-tmpl/prog/en/modules/catalogue/moredetail.tt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt index 5a5327baca..efbf925a16 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt @@ -439,9 +439,10 @@ [% IF (ITEM_DAT.datelastborrowed ) %][% ITEM_DAT.datelastborrowed | $KohaDates %][% END %] [% IF Koha.Preference('StoreLastBorrower') && ITEM_DAT.object.last_returned_by %] + [% SET last_returned_by = ITEM_DAT.object.last_returned_by.cardnumber || ITEM_DAT.object.last_returned_by.borrowernumber %]
  • Last returned by: - [% ITEM_DAT.object.last_returned_by.cardnumber | html %] + [% last_retruned_by | html %]
  • [% END %] [% FOR i IN ITEM_DAT.old_issues %] @@ -452,7 +453,8 @@ [% ELSE %] Previous borrower: [% END %] - [% b.cardnumber | html %]  + [% SET last_or_previous_borrower = b.cardnumber || b.borrowernumber %] + [% last_or_previous_borrower| html %]  [% END %] [% IF ( ITEM_DAT.paidfor ) %] -- 2.34.1