Bug 34681 - Last returned by and last/previous borrower doesn't display if patron's cardnumber is empty
Summary: Last returned by and last/previous borrower doesn't display if patron's cardn...
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Lucas Gass (lukeg)
QA Contact: Matt Blenkinsop
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-08-31 18:42 UTC by hebah
Modified: 2025-01-30 17:07 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This fixes a bug where the 'Last borrower' and 'Previous borrower' links did not appear when the borrower lacked a cardnumber. This patch makes it fall back to borrowernumber in those cases.
Version(s) released in:
25.05.00
Circulation function:


Attachments
Bug 34681: Fallback to borrowernumber when there is no cardnumber (3.36 KB, patch)
2025-01-21 16:41 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 34681: Fallback to borrowernumber when there is no cardnumber (3.47 KB, patch)
2025-01-23 08:36 UTC, Magnus Enger
Details | Diff | Splinter Review
Bug 34681: Follow up - fix typo (1.61 KB, patch)
2025-01-23 08:36 UTC, Magnus Enger
Details | Diff | Splinter Review
Bug 34681: Fallback to borrowernumber when there is no cardnumber (3.54 KB, patch)
2025-01-24 15:10 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 34681: Follow up - fix typo (1.67 KB, patch)
2025-01-24 15:10 UTC, Matt Blenkinsop
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description hebah 2023-08-31 18:42:46 UTC
To recreate:
Have StoreLastBorrower enabled to store Last Returned By.
Create account and leave cardnumber empty.
Check out and return item with that account.
Go to items detail page.
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.

Most libraries will usually have a value in cardnumber, but if they don't for any reason, perhaps for in-house cards or by user error, it hides important circ information.
Comment 1 Lucas Gass (lukeg) 2025-01-21 16:41:16 UTC Comment hidden (obsolete)
Comment 2 Magnus Enger 2025-01-23 08:36:45 UTC
Created attachment 176940 [details] [review]
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 <magnus@libriotech.no>
Works as advertised, with the tiny followup I am providing.
Comment 3 Magnus Enger 2025-01-23 08:36:48 UTC
Created attachment 176941 [details] [review]
Bug 34681: Follow up - fix typo

Change from: [% last_retruned_by | html %]
To: [% last_returned_by | html %]
Comment 4 Matt Blenkinsop 2025-01-24 15:10:01 UTC
Created attachment 177117 [details] [review]
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 <magnus@libriotech.no>
Works as advertised, with the tiny followup I am providing.
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Comment 5 Matt Blenkinsop 2025-01-24 15:10:04 UTC
Created attachment 177118 [details] [review]
Bug 34681: Follow up - fix typo

Change from: [% last_retruned_by | html %]
To: [% last_returned_by | html %]

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Comment 6 Katrin Fischer 2025-01-30 17:07:12 UTC
Pushed for 25.05!

Well done everyone, thank you!