Bug 23281

Summary: Add Koha::Objects::Limit::Library
Product: Koha Reporter: Tomás Cohen Arazi <tomascohen>
Component: Architecture, internals, and plumbingAssignee: Tomás Cohen Arazi <tomascohen>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: fridolin.somers, jonathan.druart, kyle, martin.renvoize
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Medium patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
19.11.00
Bug Depends on: 17755    
Bug Blocks: 15497, 23271, 23272, 23599, 23830    
Attachments: Bug 23281: Add Koha::Objects::Limit::Library
Bug 23281: Implement ->search_with_library_limits in Koha::Patron::Attribute::Types
Bug 23281: Cleanup Koha::Patron::Attribute::Types->search
Bug 23281: Add Koha::Objects::Limit::Library
Bug 23281: Implement ->search_with_library_limits in Koha::Patron::Attribute::Types
Bug 23281: Cleanup Koha::Patron::Attribute::Types->search
Bug 23281: Add Koha::Objects::Limit::Library
Bug 23281: Implement ->search_with_library_limits in Koha::Patron::Attribute::Types
Bug 23281: Cleanup Koha::Patron::Attribute::Types->search

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>
Comment 8 Katrin Fischer 2019-08-17 19:23:05 UTC
Created attachment 92337 [details] [review]
Bug 23281: Add Koha::Objects::Limit::Library

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 9 Katrin Fischer 2019-08-17 19:23:09 UTC
Created attachment 92338 [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>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 10 Katrin Fischer 2019-08-17 19:23:13 UTC
Created attachment 92339 [details] [review]
Bug 23281: Cleanup Koha::Patron::Attribute::Types->search

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 11 Martin Renvoize 2019-08-19 09:25:18 UTC
Nice work!

Pushed to master for 19.11.00
Comment 12 Fridolin Somers 2019-09-05 15:07:58 UTC
Enhancement not pushed to 19.05.x