Bug 8919 - ExtendedPatronAttributes not populated from LDAP
Summary: ExtendedPatronAttributes not populated from LDAP
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Authentication (show other bugs)
Version: 3.10
Hardware: All All
: P1 - high critical (vote)
Assignee: Dobrica Pavlinusic
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-15 12:52 UTC by Dobrica Pavlinusic
Modified: 2019-06-27 09:24 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 8919 - ExtendedPatronAttributes not populated from LDAP (1.96 KB, patch)
2012-10-15 13:03 UTC, Dobrica Pavlinusic
Details | Diff | Splinter Review
Bug 8919 - ExtendedPatronAttributes not populated from LDAP (2.21 KB, patch)
2012-10-16 11:41 UTC, Dobrica Pavlinusic
Details | Diff | Splinter Review
Bug 8919 - ExtendedPatronAttributes not populated from LDAP (2.26 KB, patch)
2012-10-16 20:22 UTC, Dobrica Pavlinusic
Details | Diff | Splinter Review
Bug 8919 - ExtendedPatronAttributes not populated from LDAP (2.32 KB, patch)
2012-11-04 08:13 UTC, Chris Cormack
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Dobrica Pavlinusic 2012-10-15 12:52:34 UTC

    
Comment 1 Dobrica Pavlinusic 2012-10-15 13:03:29 UTC Comment hidden (obsolete)
Comment 2 Dobrica Pavlinusic 2012-10-16 11:41:04 UTC Comment hidden (obsolete)
Comment 3 Dobrica Pavlinusic 2012-10-16 20:22:40 UTC Comment hidden (obsolete)
Comment 4 Chris Cormack 2012-11-04 08:13:42 UTC
Created attachment 13241 [details] [review]
Bug 8919 - ExtendedPatronAttributes not populated from LDAP

Current code is overly complex and assumes that
C4::Members::AttributeTypes::GetAttributeTypes
returns array of attribute codes which is not true.

Instead it return array of hashes so none of extended attributes
will be replicated from LDAP.

This code correctly extracts extended attributes from borrower data
provides simpler code which fills same structure.

It also skips empty values (" ") which are result of mapping without
any default value. This is needed to make unique extended patron values
work. If not handled it would insert empty value for first user and
fail for all others on uniqueness constraint.

Test scenario:

1. define Patron attribute types in administration
2. define mapping from LDAP fields to attributes in koha-conf.xml
3. login as new user with LDAP fields and verify that extended
   attributes are replicated from LDAP

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Comment 5 Paul Poulain 2012-11-08 17:18:06 UTC
QA comment:
 * path passes QA
 * I haven't tested it, bug the code seems logical
 * the asumption Current code is overly complex and assumes that
C4::Members::AttributeTypes::GetAttributeTypes
returns array of attribute codes which is not true.
 is definetly correct (and is properly documented in C4/Members/AttributesTypes.pm

passed QA
Comment 6 Jared Camins-Esakov 2012-11-08 17:46:17 UTC
This patch has been pushed to master.
Comment 7 Paul Poulain 2012-11-12 13:22:33 UTC
Patch pushed to branch 3.10.x
Comment 8 Chris Cormack 2013-04-22 08:41:05 UTC
Released in 3.10.0