| Summary: | for loop in Auth_with_ldap.pm requires an extended patron attribute to be set or LDAP logins fail | ||
|---|---|---|---|
| Product: | Koha | Reporter: | Bryan Lakatos <bryan.lakatos> |
| Component: | Architecture, internals, and plumbing | Assignee: | Nuño López Ansótegui <nunyo.lopez> |
| Status: | CLOSED FIXED | QA Contact: | Jonathan Druart <jonathan.druart> |
| Severity: | major | ||
| Priority: | P3 | CC: | dpavlin, gmcharlt, jonathan.druart, nunyo.lopez, robin, srdjan, tomascohen |
| Version: | 3.12 | ||
| Hardware: | All | ||
| OS: | All | ||
| See Also: | http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10925 | ||
| GIT URL: | Initiative type: | --- | |
| Sponsorship status: | --- | Comma delimited list of Sponsors: | |
| Crowdfunding goal: | 0 | Patch complexity: | --- |
| Documentation contact: | Documentation submission: | ||
| Text to go in the release notes: | Version(s) released in: | ||
| Circulation function: | |||
| Attachments: |
bug_9299: rework unique attributes check on ldap login
[SIGNED-OFF] bug_9299: rework unique attributes check on ldap login Bug 9299: rework unique attributes check on ldap login |
||
I've seen this happen when extended attributes are defined, but it's definitely a problem. It might be when none are assigned to the user, or something like that. Created attachment 18652 [details] [review] bug_9299: rework unique attributes check on ldap login To test: Have ldap server set up in koha-conf.xml and ExtendedPatronAttributes syspref enabled, with no extended attributes defined. Successful login should not throw an exception. Created attachment 19861 [details] [review] [SIGNED-OFF] bug_9299: rework unique attributes check on ldap login Works fine. I verify that the submitted fix works. Can we move this on down the line into the package? Thanks! Created attachment 21279 [details] [review] Bug 9299: rework unique attributes check on ldap login commit 73e89ab1bf24e8b43560ac0218ac0144d81985df Author: Srdjan <srdjan@catalyst.net.nz> Date: Wed Jun 5 16:34:29 2013 +1200 Bug 9299: rework unique attributes check on ldap login To reproduce: - configure a ldap server and $KOHA_CONF, etc. - try to log in - you will got a software error: Can't use an undefined value as an ARRAY reference at /home/koha/src/C4/Auth_with_ldap.pm line 183. Signed-off-by: Nuño López Ansótegui <nunyo@masmedios.com> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> I reproduce the issue and I configure this patch fixes it. Marked as Passed QA. s/configure/confirm... Pushed to master. Thanks, Srdjan! I think we have run into this problem in 3.12 - maybe a candidate for a backport? Not sure if there are dependencies on other features in master. (In reply to Katrin Fischer from comment #10) > I think we have run into this problem in 3.12 - maybe a candidate for a > backport? Not sure if there are dependencies on other features in master. It is a problem on 3.12, I'll change the version setting to indicate that. This patch has been pushed to 3.12.x, will be in 3.12.7. Thanks Srdjan! |
If ExtendedPatronAttributes is enabled but no extended attributes are defined, then the for loop starting on line 181 of Auth_with_ldap.pm causes the array mentioned there to be undefined. This causes an error which prohibits LDAP logins: (the error returned is) Can't use an undefined value as an ARRAY reference at /usr/share/koha/lib/C4/Auth_with_ldap.pm line 181, <DATA> line 522. Disabling ExtendedPatronAttributes gets around the problem, but the loop ought to be made to do nothing if there are no attributes configured/defined. The offending loop: for (my $i; $i< scalar(@$extended_patron_attributes)-1;$i++) { my $attr=$extended_patron_attributes->[$i]; unless (C4::Members::Attributes::CheckUniqueness($attr->{code}, $attr->{value}, $borrowernumber)) { unshift @errors, $i; warn "ERROR_extended_unique_id_failed $attr->{code} $attr->{value}"; }