https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16719
Bug ID: 16719
Summary: LDAP: Using empty strings as 'failsafe' attribute
mapping defeats database constraints
Change sponsored?: ---
Product: Koha
Version: 3.22
Hardware: All
OS: All
Status: NEW
Severity: major
Priority: P5 - low
Component: Authentication
Assignee: [email protected]
Reporter: [email protected]
QA Contact: [email protected]
CC: [email protected]
Created attachment 52316
-->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=52316&action=edit
Patch: proper NULL mapping
LDAP attributes with empty values are currently mapped as empty strings, which
is described as 'failsafe'. This defeats the existing database constraints
(NULL and UNIQUE) without an apparent need. If some kind of empty default is
required, it should be set in the mapping config itself, not the code.
Please note that this is not just a semantic issue since mapping empty LDAP
values as an empty string does indeed cause a constraint violation (read:
database error, hence our severity) when such an attribute bears a UNIQUE
constraint. This is due to the fact that an empty string is an actual value
validated by the constraint (NULL isn't).
I don't know the reasoning behind the empty-string mapping but should a
NULL-mapping have been the original intention then please note that this
behavior is database-dependent. The correct way to map NULL in a
database-agnostic way is to use "undef" (see my patch).
Thanks
--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/