Summary: | ExtendedPatronAttributes not populated from LDAP | ||
---|---|---|---|
Product: | Koha | Reporter: | Dobrica Pavlinusic <dpavlin> |
Component: | Authentication | Assignee: | Dobrica Pavlinusic <dpavlin> |
Status: | CLOSED FIXED | QA Contact: | |
Severity: | critical | ||
Priority: | P1 - high | CC: | chris, dpavlin, jcamins, paul.poulain |
Version: | 3.10 | ||
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 8919 - ExtendedPatronAttributes not populated from LDAP
Bug 8919 - ExtendedPatronAttributes not populated from LDAP Bug 8919 - ExtendedPatronAttributes not populated from LDAP Bug 8919 - ExtendedPatronAttributes not populated from LDAP |
Description
Dobrica Pavlinusic
2012-10-15 12:52:34 UTC
Created attachment 12814 [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 simplier code which fills same structure. 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 Created attachment 12848 [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 Created attachment 12868 [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 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> 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 This patch has been pushed to master. Patch pushed to branch 3.10.x Released in 3.10.0 |