Bug 12304

Summary: Creating a user via LDAP doesn't populate message preferences
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: PatronsAssignee: Bugs List <koha-bugs>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: gmcharlt, kyle.m.hall, tomascohen, ulrich.kleiber
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:
Attachments: BUG 12304: LDAP auto-provisioning set default messaging preferences
BUG 12304: LDAP auto-provisioning set default messaging preferences
[SIGNED OFF] BUG 12304: LDAP auto-provisioning set default messaging preferences
BUG 12304: LDAP auto-provisioning set default messaging preferences
[PASSED QA] BUG 12304: LDAP auto-provisioning set default messaging preferences

Description Katrin Fischer 2014-05-21 13:26:51 UTC
This was reported for Koha 3.12.09, but I couldn't find any bug report. So it's possible that's still the case in current versions of Koha:

When a patron is created using LDAP, the message preferences configured for the patron category are not set for the patron.

Patrons created manually or imported via CSV have the correct messaging settings.

I would appreciate if someone on a newer version using LDAP could confirm if this is a problem there as well or not.
Comment 1 Katrin Fischer 2014-05-21 14:09:59 UTC
Looking at the code and with Martin's help I think adding this after the AddMember call in the LDAP code could solve the problem:

C4::Members::Messaging::SetMessagingPreferencesFromDefaults( { borrowernumber => $borrower{'borrowernumber'}, categorycode => $borrower{'categorycode'} } );

Untested so far.
Comment 2 Martin Renvoize 2014-05-21 14:20:23 UTC Comment hidden (obsolete)
Comment 3 Katrin Fischer 2014-05-21 20:29:06 UTC
Comment on attachment 28409 [details] [review]
BUG 12304: LDAP auto-provisioning set default messaging preferences

This is awesome, thx Martin!
Comment 4 Martin Renvoize 2014-05-22 05:31:44 UTC Comment hidden (obsolete)
Comment 5 Ulrich Kleiber 2014-06-12 12:04:23 UTC
Manually applied to 3.12.9 and it works beautifully in test and production.

Thanks Martin!
Comment 6 Katrin Fischer 2014-06-15 06:37:55 UTC Comment hidden (obsolete)
Comment 7 Chris Cormack 2014-06-19 09:20:45 UTC Comment hidden (obsolete)
Comment 8 Katrin Fischer 2014-06-20 07:22:03 UTC
This is also a problem in current master!
Comment 9 Kyle M Hall 2014-06-20 16:14:07 UTC
Created attachment 29114 [details] [review]
[PASSED QA] BUG 12304: LDAP auto-provisioning set default messaging preferences

LDAP auto-provisioning should set default messaging preferences upon
creation of a user.

Signed-off-by: Ulrich Kleiber <ulrich.kleiber@bsz-bw.de>
Manually applied to 3.12.9 and it works beautifully in test and production.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 10 Tomás Cohen Arazi 2014-07-02 18:18:07 UTC
Patch pushed to master.

Thanks Martin!
Comment 11 Galen Charlton 2014-07-23 21:33:39 UTC
Pushed to 3.16.x for inclusion in 3.16.2.