Bug 23583

Summary: Handle OpacHiddenItems with yaml_preference
Product: Koha Reporter: Tomás Cohen Arazi <tomascohen>
Component: Architecture, internals, and plumbingAssignee: Tomás Cohen Arazi <tomascohen>
Status: CLOSED FIXED QA Contact: Katrin Fischer <katrin.fischer>
Severity: enhancement    
Priority: P5 - low CC: david, fridolin.somers, katrin.fischer, victor
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.05.00
Bug Depends on: 27673    
Bug Blocks: 24403    
Attachments: Bug 23583: Handle OpacHiddenItems with yaml_preference
Bug 23583: Handle OpacHiddenItems with yaml_preference
Bug 23583: Handle OpacHiddenItems with yaml_preference

Description Tomás Cohen Arazi 2019-09-10 16:45:39 UTC

    
Comment 1 Tomás Cohen Arazi 2021-04-06 14:40:22 UTC
Created attachment 119222 [details] [review]
Bug 23583: Handle OpacHiddenItems with yaml_preference

This patch makes all places in Koha that rely on OpacHiddenItems
actually use C4::Context->yaml_preference instead of manually calling
the YAML libraries and handling it.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Items* \
           t/db_dependent/Koha/Item* \
           t/db_dependent/Koha/Filter/EmbedItems.t
=> SUCCESS: Tests pass!
3. Try hiding things with opac-ISBDdetail.pl and opac-search.pl
=> SUCCESS: Things work the same!
4. Sign off :-D
Comment 2 David Nind 2021-04-06 20:44:43 UTC
Created attachment 119246 [details] [review]
Bug 23583: Handle OpacHiddenItems with yaml_preference

This patch makes all places in Koha that rely on OpacHiddenItems
actually use C4::Context->yaml_preference instead of manually calling
the YAML libraries and handling it.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Items* \
           t/db_dependent/Koha/Item* \
           t/db_dependent/Koha/Filter/EmbedItems.t
=> SUCCESS: Tests pass!
3. Try hiding things with opac-ISBDdetail.pl and opac-search.pl
=> SUCCESS: Things work the same!
4. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 David Nind 2021-04-06 20:52:25 UTC
Testing notes:
- Added withdrawn: [1] to OpacHiddenItems
- Changed status of one item for a record with multiple items to Withdrawn
  . In OPAC the withdrawn item doesn't show in the search results, OPAC detail page or MARC view tab (the ISBD view doesn't show items before or after the patch is applied)
- Changed the status to withdrawn for a record that only has one item:
  . Doesn't show up in the OAPC search results
  . 404 message if you click on the OPAC view link in from the staff interface details page
- Ran tests before and after - all pass
Comment 4 Katrin Fischer 2021-04-17 23:27:55 UTC
Created attachment 119804 [details] [review]
Bug 23583: Handle OpacHiddenItems with yaml_preference

This patch makes all places in Koha that rely on OpacHiddenItems
actually use C4::Context->yaml_preference instead of manually calling
the YAML libraries and handling it.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Items* \
           t/db_dependent/Koha/Item* \
           t/db_dependent/Koha/Filter/EmbedItems.t
=> SUCCESS: Tests pass!
3. Try hiding things with opac-ISBDdetail.pl and opac-search.pl
=> SUCCESS: Things work the same!
4. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Jonathan Druart 2021-04-21 13:29:50 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 6 Fridolin Somers 2021-04-29 13:34:39 UTC
Depends on Bug 27673 not in 20.11.x
Comment 7 Tomás Cohen Arazi 2021-10-13 15:01:32 UTC
*** Bug 28359 has been marked as a duplicate of this bug. ***