Bug 22139

Summary: Fields of ACCTDETAILS not working properly
Product: Koha Reporter: Muneeb Kalathil <muneebkalathil>
Component: NoticesAssignee: Muneeb Kalathil <muneebkalathil>
Status: CLOSED FIXED QA Contact: Martin Renvoize <martin.renvoize>
Severity: major    
Priority: P2 CC: barton, katrin.fischer, kris.sinnaeve, lisettepalouse+koha, lucas, martin.renvoize, mkstephens, nick, wizzyrea
Version: 18.11   
Hardware: All   
OS: Linux   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
19.05.00, 18.11.05
Attachments: Patch file to fix this bug.
Bug 22139: Fields of ACCTDETAILS email not populating
Bug 22139: Fields of ACCTDETAILS email not populating
Bug 22139: Fields of ACCTDETAILS email not populating

Description Muneeb Kalathil 2019-01-16 05:29:52 UTC
Some of the fields in ACCTDETAILS is not working properly when we create new patrons. There is no problem in receiving mails.

The only field it takes is <<borrowers.password>>

The remaining fields in this notice does not showing any values in the mail.
<<borrowers.title>> <<borrowers.firstname>> <<borrowers.surname>>

<<borrowers.userid>>

#####################################

This is the mail I recieved.

Hello  .

Your new Koha account details are:

User:  
Password: 1234


If you have any problems or questions regarding your account, please contact your Koha Administrator.


Thank you,
Librarian
library@xxxx

#####################################

* Checkout notice is working fine with ACCTDETAILS details.
* Also I imported this DB to 18.05 and it is working perfectly; No issues .
* Didn't find any errors in log related to this.
Comment 1 Katrin Fischer 2019-04-04 09:17:05 UTC
> #####################################
> 
> * Checkout notice is working fine with ACCTDETAILS details.
> * Also I imported this DB to 18.05 and it is working perfectly; No issues .
> * Didn't find any errors in log related to this.

Do you mean it's a regression from 18.05 to 18.11?
Comment 2 Barton Chittenden 2019-04-11 20:56:44 UTC
Can confirm; we just had a partner upgrade from 18.05 to 18.11. Was working in 18.05, is not working now.
Comment 3 Myka Kennedy Stephens 2019-04-11 21:22:25 UTC
We are said partner. As a workaround, we're planning to rewrite the notice so that it is more generic and doesn't use the remaining fields from the borrowers table. It is odd, however, that the notice does pass through borrowers.password but not the others.

Thanks for taking a look at this!
Comment 4 Muneeb Kalathil 2019-04-12 09:47:34 UTC
(In reply to Katrin Fischer from comment #1)
> > #####################################
> > 
> > * Checkout notice is working fine with ACCTDETAILS details.
> > * Also I imported this DB to 18.05 and it is working perfectly; No issues .
> > * Didn't find any errors in log related to this.
> 
> Do you mean it's a regression from 18.05 to 18.11?

New Installation on 18.11 - Not working
DB from 18.11 to 18.05 - Its working
Comment 5 Lisette Scheer 2019-04-12 15:43:24 UTC
We are also having this issue. 
We are using TT syntax in this notice and it was working yesterday but not today for borrower information. It does work still for branch information.
We updated to 18.11.03 overnight. 
Lisette
Comment 6 Kris Sinnaeve 2019-04-17 15:47:58 UTC
Created attachment 88207 [details] [review]
Patch file to fix this bug.
Comment 7 Kris Sinnaeve 2019-04-17 15:49:45 UTC
This bug is indeed introduced between Koha 18.05 and Koha 18.11 when moving AddMember and ModMember from Members to Patron.

I expect it's fixed by adding the following line after storing the new patron:
$newdata{'borrowernumber'} = $borrowernumber;
Comment 8 Liz Rea 2019-04-17 17:29:08 UTC
Created attachment 88216 [details] [review]
Bug 22139: Fields of ACCTDETAILS email not populating

To test:
* Make sure AutoEmailOpacUser is set to "send"
* Create a new patron with a username and password, and an email address
* In Kohadevbox, check the mail (usually you can type "mail" and go down
to the last message) - these do not go into the message queue and they
are processed immediately.
notice that the email does not have
<<borrowers.title>> <<borrowers.firstname>> <<borrowers.surname>>

Apply this patch, restart the things, retest as above.
Comment 9 Liz Rea 2019-04-17 17:29:50 UTC
Formatting patch for community guidelines, authorship retained by Kris.
Comment 10 Hayley Pelham 2019-04-18 00:33:01 UTC
Created attachment 88245 [details] [review]
Bug 22139: Fields of ACCTDETAILS email not populating

To test:
* Make sure AutoEmailOpacUser is set to "send"
* Create a new patron with a username and password, and an email address
* In Kohadevbox, check the mail (usually you can type "mail" and go down
to the last message) - these do not go into the message queue and they
are processed immediately.
notice that the email does not have
<<borrowers.title>> <<borrowers.firstname>> <<borrowers.surname>>

Apply this patch, restart the things, retest as above.

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Comment 11 Martin Renvoize 2019-04-18 07:06:35 UTC
Created attachment 88257 [details] [review]
Bug 22139: Fields of ACCTDETAILS email not populating

To test:
* Make sure AutoEmailOpacUser is set to "send"
* Create a new patron with a username and password, and an email address
* In Kohadevbox, check the mail (usually you can type "mail" and go down
to the last message) - these do not go into the message queue and they
are processed immediately.
notice that the email does not have
<<borrowers.title>> <<borrowers.firstname>> <<borrowers.surname>>

Apply this patch, restart the things, retest as above.

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 12 Martin Renvoize 2019-04-18 07:07:31 UTC
Perfect fix, thankyou very much for fixing it before I got down to it in my todo list :)

Passing QA and welcome to the team :).
Comment 13 Kris Sinnaeve 2019-04-18 07:14:44 UTC
For me it was a show stopper to migrate from Koha 3.20 to Koha 18.11.
It took me some time to find the root cause.
A diff between the Koha 18.05 version of memberentry.pl and the Koha 18.11 version of memberentry.pl pointed me into the right direction.
Comment 14 Nick Clemens 2019-04-18 12:07:08 UTC
Awesome work all!

Pushed to master for 19.05
Comment 15 Martin Renvoize 2019-04-26 13:42:13 UTC
Pushed to 18.11.x for 18.11.05
Comment 16 Lucas Gass 2019-05-10 21:16:02 UTC
not backporting to 18.05.x
Comment 17 Lucas Gass 2019-05-10 21:16:31 UTC
not backporting to 18.05.x
Comment 18 Aman Mishra 2019-08-13 10:37:59 UTC
Comment on attachment 88207 [details] [review]
Patch file to fix this bug.

Review of attachment 88207 [details] [review]:
-----------------------------------------------------------------

Thanks this patch is working fine