Bug 12304 - Creating a user via LDAP doesn't populate message preferences
Summary: Creating a user via LDAP doesn't populate message preferences
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-21 13:26 UTC by Katrin Fischer
Modified: 2015-06-04 23:30 UTC (History)
4 users (show)

See Also:
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 (1.20 KB, patch)
2014-05-21 14:20 UTC, Martin Renvoize
Details | Diff | Splinter Review
BUG 12304: LDAP auto-provisioning set default messaging preferences (1.19 KB, patch)
2014-05-22 05:31 UTC, Martin Renvoize
Details | Diff | Splinter Review
[SIGNED OFF] BUG 12304: LDAP auto-provisioning set default messaging preferences (1.33 KB, patch)
2014-06-15 06:37 UTC, Katrin Fischer
Details | Diff | Splinter Review
BUG 12304: LDAP auto-provisioning set default messaging preferences (1.37 KB, patch)
2014-06-19 09:20 UTC, Chris Cormack
Details | Diff | Splinter Review
[PASSED QA] BUG 12304: LDAP auto-provisioning set default messaging preferences (1.46 KB, patch)
2014-06-20 16:14 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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.