From 63ffc8655155fee8c5917948f2b5f70be206c79a Mon Sep 17 00:00:00 2001 From: Marion Durand Date: Wed, 29 Oct 2025 16:01:24 +0000 Subject: [PATCH] Bug 41132: make 'branch' available in password reset notification The variable 'branch' in TemplateToolkit (or 'branches' in hungry aligator syntax) is now available in notification for password reset (PASSWORD_RESET an STAFF_PASSWORD_RESET). The branch of the patron will be used. To test: 1- Edit the template for PASSWORD_RESET and STAFF_PASSWORD_RESET to add <> and [% branch.branchname %] 2- Make sure syspref OpacResetPassword to allowed to be able to reset the password from OPAC and staff interface 3- Generate both notices a- In the staff interface, go to the patron record, click "More" then "Send password reset" b- In the OPAC, Click on "Forgot your password?" and enter the email (or cardnumber) (you might need to click "Get new password recovery link") 4- Check the notices, from the patron record go to the notices tab, make sure that the branch name is not displayed (black) 5- Apply the patch 6- Repeate step 3 and check the notices, the branch name is now displayed Note: if using KTD email will not be sent and on the OPAC side you have an error message telling that the email was not send. This is not a problem for our testing as we can check the notices from the interface. --- Koha/Patron/Password/Recovery.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/Koha/Patron/Password/Recovery.pm b/Koha/Patron/Password/Recovery.pm index fe2f974e8d..92fe2a2a1a 100644 --- a/Koha/Patron/Password/Recovery.pm +++ b/Koha/Patron/Password/Recovery.pm @@ -139,6 +139,7 @@ sub SendPasswordRecoveryEmail { letter_code => $staff ? 'STAFF_PASSWORD_RESET' : 'PASSWORD_RESET', branchcode => $borrower->branchcode, lang => $borrower->lang, + tables => { 'branches' => $borrower->branchcode }, substitute => { passwordreseturl => $uuidLink, user => $borrower->userid }, ); -- 2.39.5