[Bug 24132] New: search_with_library_limits vs filter_by_branch_limitations
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24132 Bug ID: 24132 Summary: search_with_library_limits vs filter_by_branch_limitations Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: jonathan.druart@bugs.koha-community.org QA Contact: testopia@bugs.koha-community.org Depends on: 20443 Aside from the naming of these two subroutines (implemented at different times), Koha::Patron::Attribute::Types->search_with_library_limits and Koha::Patron::Attributes->filter_by_branch_limitations looks similar and that the code must be simplified. The join table is between borrower_attribute_types and branches (borrower_attribute_types_branches). So Koha::Patron::Attribute::Types can inherit directly from Koha::Objects::Limit::Library, not Koha::Patron::Attributes There are a couple of ways to deal with that: 1. Improve Koha::Objects::Limit::Library => Sounds wrong as there is no join table between borrower_attributes and branches 2. Remove Koha::Patron::Attributes->filter_by_branch_limitations and replace it by something like: my $attribute_types = Koha::Patron::Attribute::Types ->search_with_library_limits; my $attribute = $patron->extended_attributes ->search({ code => { -in => attribute_types->column('code') } }); Which sounds more correct. 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=24132 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Jonathan Druart from comment #0)
Aside from the naming of these two subroutines (implemented at different times), Koha::Patron::Attribute::Types->search_with_library_limits and Koha::Patron::Attributes->filter_by_branch_limitations looks similar and that the code must be simplified.
The join table is between borrower_attribute_types and branches (borrower_attribute_types_branches). So Koha::Patron::Attribute::Types can inherit directly from Koha::Objects::Limit::Library, not Koha::Patron::Attributes
There are a couple of ways to deal with that: 1. Improve Koha::Objects::Limit::Library => Sounds wrong as there is no join table between borrower_attributes and branches 2. Remove Koha::Patron::Attributes->filter_by_branch_limitations and replace it by something like: my $attribute_types = Koha::Patron::Attribute::Types ->search_with_library_limits; my $attribute = $patron->extended_attributes ->search({ code => { -in => attribute_types->column('code') } }); Which sounds more correct.
I agree with the latter, Jonathan. Let me know if we can sort this one for 21.05, to finish this consistency rewrite. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org