Bugzilla – Attachment 118364 Details for
Bug 27957
Attributes removed in LDAP
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
:x
Bug-27957-Fix-LDAP-and-patrons-attributes.patch (text/plain), 2.19 KB, created by
Jonathan Druart
on 2021-03-17 11:11:07 UTC
(
hide
)
Description:
:x
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-03-17 11:11:07 UTC
Size:
2.19 KB
patch
obsolete
>From 013382d923cc18db614bd44c85d5c9c0ae74fa92 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 17 Mar 2021 12:10:21 +0100 >Subject: [PATCH] Bug 27957: Fix LDAP and patron's attributes > >--- > C4/Auth_with_ldap.pm | 22 +++++++++------------- > 1 file changed, 9 insertions(+), 13 deletions(-) > >diff --git a/C4/Auth_with_ldap.pm b/C4/Auth_with_ldap.pm >index 36b9071426..bebc1c7fd1 100644 >--- a/C4/Auth_with_ldap.pm >+++ b/C4/Auth_with_ldap.pm >@@ -233,21 +233,17 @@ sub checkpw_ldap { > if (C4::Context->preference('ExtendedPatronAttributes') && $borrowernumber && ($config{update} ||$config{replicate})) { > my $library_id = C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef; > my $attribute_types = Koha::Patron::Attribute::Types->search_with_library_limits({}, {}, $library_id); >- while ( my $attribute_type = $attribute_types->next ) { >- my $code = $attribute_type->code; >- unless (exists($borrower{$code}) && $borrower{$code} !~ m/^\s*$/ ) { >- next; >- } >- my $patron = Koha::Patrons->find($borrowernumber); >- if ( $patron ) { # Should not be needed, but we are in C4::Auth LDAP... >- eval { >- my $attribute = Koha::Patron::Attribute->new({code => $code, attribute => $borrower{$code}}); >- $patron->extended_attributes([$attribute->unblessed]); >- }; >- if ($@) { # FIXME Test if Koha::Exceptions::Patron::Attribute::NonRepeatable >- warn "ERROR_extended_unique_id_failed $code $borrower{$code}"; >+ my $patron = Koha::Patrons->find($borrowernumber); >+ if ( $patron ) { >+ my @attributes; >+ while ( my $attribute_type = $attribute_types->next ) { >+ my $code = $attribute_type->code; >+ unless (exists($borrower{$code}) && $borrower{$code} !~ m/^\s*$/ ) { >+ next; > } >+ push @attributes, { code => $code, attribute => $borrower{$code} }; > } >+ $patron->extended_attributes(\@attributes); > } > } > return(1, $cardnumber, $userid); >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 27957
:
118364
|
118365
|
118384