Bug 32501 - Koha::Patrons::Import contains incorrect borrowernumber references
Summary: Koha::Patrons::Import contains incorrect borrowernumber references
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-12-20 08:10 UTC by Martin Renvoize (ashimema)
Modified: 2023-06-10 21:42 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 32501: Consistently refer to borrowernumber (3.45 KB, patch)
2022-12-20 08:16 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Renvoize (ashimema) 2022-12-20 08:10:23 UTC
We found that notices were going out containing raw <<borrowers.field>>. 

I narrowed it down to the fact we store the new patron object but don't then discard changes to get the autoincremented new borrowernumber so we were sending blank ID's to GePreparedLetter.  This lead me to spot the same issue in a few other locations in the script too.
Comment 1 Martin Renvoize (ashimema) 2022-12-20 08:16:16 UTC
Created attachment 144732 [details] [review]
Bug 32501: Consistently refer to borrowernumber

We had a mixture of $patron->borrowernumber, $patron->id and
$borrowernumber.

This patch updates the occurences of $patron->borrowernumber to just
refer to $borrowernumber which is set correctly throughout the script.

Test plan
1) For newly created borrowers on import check that the produced welcome
   notice correctly fills the borrower details from the template.
2) For updated borrowers in the import, check that the debartments still
   work as expected.
Comment 2 Martin Renvoize (ashimema) 2022-12-20 09:17:51 UTC
Hmm... writing a unit test for this appears to prove I'm wrong :(
Comment 3 Katrin Fischer 2023-06-10 21:42:51 UTC
Any update on this?