Bug 17627

Summary: Move C4::Koha::GetItemTypesByCategory to Koha::ItemTypes
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Architecture, internals, and plumbingAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: hagud, katrin.fischer, kyle
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on:    
Bug Blocks: 15779, 17835    
Attachments: Bug 17627: Move C4::Koha::GetItemTypesByCategory to Koha::ItemTypes
Bug 17627: Move C4::Koha::GetItemTypesByCategory to Koha::ItemTypes

Description Jonathan Druart 2016-11-15 10:15:29 UTC

    
Comment 1 Jonathan Druart 2016-11-15 10:19:40 UTC
Created attachment 57479 [details] [review]
Bug 17627: Move C4::Koha::GetItemTypesByCategory to Koha::ItemTypes

C4::Koha::GetItemTypesByCategory can be easily replaced with
Koha::ItemTypes->search({ searchcategory => ? });

So let's replace it where it is used.

Test plan:
Make sure this patch does not break the test plan of bug 10937
Comment 2 Hugo Agud 2016-11-30 13:02:41 UTC
checked using this test plan and signed off

NORMAL USAGE
2) Group your items under that new category
   a) In Intranet/Koha Admin/Item types, choose (at least) two item types and for each:
      - Click action/Edit on the right column
      - Third row (below Description) is the Search category list box, select Hardware
      - click Save changes at the bottom
3) Select at least one item to be hidden in the OPAC search
   a) In Intranet/Koha Admin/Item types (again), choose a different item type:
      -  Click action/Edit
      -  Click the checkbox "Hide in OPAC" below the list of icons.

FINAL TESTING
4) Go test your modifications
   a) Go to OPAC/Adv search.
   b) Validate that all items modified above (hidden or grouped) do not appear in Item type list
   c) Validate that new item type Hardware does appear instead.
   d) Select item Hardware, start Search.
   e) Validate returned items are the of the two types that were grouped into the Hardware category in step 4.
Comment 3 Nick Clemens 2017-02-16 00:17:21 UTC
Created attachment 60298 [details] [review]
Bug 17627: Move C4::Koha::GetItemTypesByCategory to Koha::ItemTypes

C4::Koha::GetItemTypesByCategory can be easily replaced with
Koha::ItemTypes->search({ searchcategory => ? });

So let's replace it where it is used.

Test plan:
Make sure this patch does not break the test plan of bug 10937

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 4 Kyle M Hall 2017-02-17 15:32:03 UTC
Pushed to master for 17.05, thanks Jonathan!
Comment 5 Katrin Fischer 2017-02-19 20:31:46 UTC
This won't get ported back to 16.11.x as it is an enhancement.