[Bug 27957] New: Attributes removed in LDAP
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27957 Bug ID: 27957 Summary: Attributes removed in LDAP Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: Authentication Assignee: koha-bugs@lists.koha-community.org Reporter: tomascohen@gmail.com QA Contact: testopia@bugs.koha-community.org CC: dpavlin@rot13.org Working on bug 27857 (actually, on the follow-up bug 27956), I found that the Koha::Patron->extended_attributes setter is used to write the new attributes. This happens inside a Koha::Patron::Attribute::Types loop which is used to determine 'valid' attributes (good). The problem is 'extended_attributes' actually calls: $self->extended_attributes->filter_by_branch_limitations->delete; which deletes the existing attribute. So calling it for setting a single attribute makes it... delete all the attributes each time! There's also some funky logic in checkpw_ldap. The $patron object seems to be retrieved in several places and even inside a loop. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27957 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |27956 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27956 [Bug 27956] Catch extended attributes exceptions in controllers -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27957 --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 118364 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=118364&action=edit :x -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27957 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #2 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Something like that? What do we do if an exception is raised? -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27957 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #118364|0 |1 is obsolete| | --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 118365 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=118365&action=edit Bug 27957: Fix LDAP and patron's attributes -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27957 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |20443 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20443 [Bug 20443] Move C4::Members::Attributes to Koha namespace -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27957 --- Comment #4 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Jonathan Druart from comment #2)
Something like that? What do we do if an exception is raised?
I would rather loop through them using $patron->add_extended_attribute inside a try/catch block and warning as we already do. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27957 --- Comment #5 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Then we will keep adding them, and won't deal with the constraints. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27957 --- Comment #6 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Maybe I misunderstood you. Don't you think the code is more readable as it? -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27957 --- Comment #7 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Jonathan Druart from comment #6)
Maybe I misunderstood you.
Don't you think the code is more readable as it?
Not at all. But the old behavior seemed to be to just warn on failed attributes. Using a single call like that will prevent attributes to be set. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27957 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #118365|0 |1 is obsolete| | --- Comment #8 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 118384 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=118384&action=edit Bug 27957: Fix LDAP and patron's attributes -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27957 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |jonathan.druart+koha@gmail. |ity.org |com --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Shoudl this have been marked as NSO? -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27957 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|jonathan.druart+koha@gmail. |koha-bugs@lists.koha-commun |com |ity.org --- Comment #10 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to Katrin Fischer from comment #9)
Shoudl this have been marked as NSO?
No, it's missing tests. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org