Bug 17627 - Move C4::Koha::GetItemTypesByCategory to Koha::ItemTypes
Summary: Move C4::Koha::GetItemTypesByCategory to Koha::ItemTypes
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 15779 17835
  Show dependency treegraph
 
Reported: 2016-11-15 10:15 UTC by Jonathan Druart
Modified: 2017-12-07 22:16 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 17627: Move C4::Koha::GetItemTypesByCategory to Koha::ItemTypes (4.43 KB, patch)
2016-11-15 10:19 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 17627: Move C4::Koha::GetItemTypesByCategory to Koha::ItemTypes (4.49 KB, patch)
2017-02-16 00:17 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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.