Bug 32501

Summary: Koha::Patrons::Import contains incorrect borrowernumber references
Product: Koha Reporter: Martin Renvoize (ashimema) <martin.renvoize>
Component: PatronsAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: gmcharlt, kyle.m.hall
Version: Main   
Hardware: All   
OS: All   
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

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?