Bug 23281 - Add Koha::Objects::Limit::Library
Summary: Add Koha::Objects::Limit::Library
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Tomás Cohen Arazi
QA Contact: Testopia
URL:
Keywords:
Depends on: 17755
Blocks: 23271 23272
  Show dependency treegraph
 
Reported: 2019-07-08 17:08 UTC by Tomás Cohen Arazi
Modified: 2019-07-11 10:27 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 23281: Add Koha::Objects::Limit::Library (3.11 KB, patch)
2019-07-08 18:25 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 23281: Implement ->search_with_library_limits in Koha::Patron::Attribute::Types (2.68 KB, patch)
2019-07-08 18:25 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 23281: Cleanup Koha::Patron::Attribute::Types->search (1.45 KB, patch)
2019-07-08 18:25 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 23281: Add Koha::Objects::Limit::Library (3.18 KB, patch)
2019-07-11 10:20 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 23281: Implement ->search_with_library_limits in Koha::Patron::Attribute::Types (2.75 KB, patch)
2019-07-11 10:21 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 23281: Cleanup Koha::Patron::Attribute::Types->search (1.52 KB, patch)
2019-07-11 10:21 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Cohen Arazi 2019-07-08 17:08:35 UTC
Add a generic class that can be used to add ->search_with_library_limits method to classes that already rely on Koha::Object::Limit::Library, but handle searching with limits manually.
Comment 1 Tomás Cohen Arazi 2019-07-08 18:25:03 UTC
Created attachment 91415 [details] [review]
Bug 23281: Add Koha::Objects::Limit::Library
Comment 2 Tomás Cohen Arazi 2019-07-08 18:25:09 UTC
Created attachment 91416 [details] [review]
Bug 23281: Implement ->search_with_library_limits in Koha::Patron::Attribute::Types

This patch makes Koha::Patron::Attribute::Types inherit from
Koha::Objects::Limit::Library so it now has the
->search_with_library_limits method.

Tests are adjusted so it is clear that there is no behaviour change
compared to the (previsouly) called ->search

To test:
- Run:
 k$ prove t/db_dependent/Koha/Patron/Attribute/Types.t
=> SUCCESS: Tests pass!
- Apply this patch
- Run:
 k$ prove t/db_dependent/Koha/Patron/Attribute/Types.t
=> SUCCESS: Tests still pass!
- Sign off :-D
Comment 3 Tomás Cohen Arazi 2019-07-08 18:25:18 UTC
Created attachment 91417 [details] [review]
Bug 23281: Cleanup Koha::Patron::Attribute::Types->search
Comment 4 Tomás Cohen Arazi 2019-07-08 18:28:11 UTC
Note to testers: Koha::Patron::Attribute::Tyes->search is not actually used in the code. It should be used for getting rid of C4::AttributeTypes. Once we have a clear idea about this patchset, this tasks could be done easily during this release cycle.

I have already filed bug 23272 and bug 23271, that would benefit from this dev.
Comment 5 Kyle M Hall 2019-07-11 10:20:52 UTC
Created attachment 91459 [details] [review]
Bug 23281: Add Koha::Objects::Limit::Library

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 6 Kyle M Hall 2019-07-11 10:21:02 UTC
Created attachment 91460 [details] [review]
Bug 23281: Implement ->search_with_library_limits in Koha::Patron::Attribute::Types

This patch makes Koha::Patron::Attribute::Types inherit from
Koha::Objects::Limit::Library so it now has the
->search_with_library_limits method.

Tests are adjusted so it is clear that there is no behaviour change
compared to the (previsouly) called ->search

To test:
- Run:
 k$ prove t/db_dependent/Koha/Patron/Attribute/Types.t
=> SUCCESS: Tests pass!
- Apply this patch
- Run:
 k$ prove t/db_dependent/Koha/Patron/Attribute/Types.t
=> SUCCESS: Tests still pass!
- Sign off :-D

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 7 Kyle M Hall 2019-07-11 10:21:05 UTC
Created attachment 91461 [details] [review]
Bug 23281: Cleanup Koha::Patron::Attribute::Types->search

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>