Bug 22454 - Add Koha::Item::hidden_in_opac method
Summary: Add Koha::Item::hidden_in_opac method
Status: RESOLVED FIXED
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:
Blocks: 22455 22749
  Show dependency treegraph
 
Reported: 2019-03-05 12:44 UTC by Tomás Cohen Arazi
Modified: 2019-04-22 18:07 UTC (History)
6 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 22454: Unit tests (2.08 KB, patch)
2019-03-05 12:47 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 22454: Add Koha::Item::hidden_in_opac method (1.88 KB, patch)
2019-03-05 12:47 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 22454: Add Koha::Item::hidden_in_opac method (1.93 KB, patch)
2019-03-12 08:55 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 22454: Unit tests (2.19 KB, patch)
2019-03-12 10:12 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 22454: Add Koha::Item::hidden_in_opac method (1.98 KB, patch)
2019-03-12 10:12 UTC, Josef Moravec
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-03-05 12:44:08 UTC
We need such a method to determine if an item needs to be hidden in OPAC. It should take the OpacHiddenItems hashref as (optional) parameter. The case for 'exceptions' is left out on purpose. This should be just calculated by the calling party.
Comment 1 Tomás Cohen Arazi 2019-03-05 12:47:48 UTC
Created attachment 86061 [details] [review]
Bug 22454: Unit tests
Comment 2 Tomás Cohen Arazi 2019-03-05 12:47:52 UTC
Created attachment 86062 [details] [review]
Bug 22454: Add Koha::Item::hidden_in_opac method

This patch adds a hidden_in_opac method that does the same calculation
done in GetHiddenItemnumbers, but for a single item, and doesn't get the
OpacHiddenItems syspref, but expects them to be passed as parameters (to
avoid multiple reads).

To test:
- Apply this patches
- Run:
  $ kshell
 k$ prove t/db_dependent/Koha/Item.t
=> SUCCESS: Tests pass!
Comment 3 Michal Denar 2019-03-12 08:55:10 UTC
Created attachment 86501 [details] [review]
Bug 22454: Add Koha::Item::hidden_in_opac method

This patch adds a hidden_in_opac method that does the same calculation
done in GetHiddenItemnumbers, but for a single item, and doesn't get the
OpacHiddenItems syspref, but expects them to be passed as parameters (to
avoid multiple reads).

To test:
- Apply this patches
- Run:
  $ kshell
 k$ prove t/db_dependent/Koha/Item.t
=> SUCCESS: Tests pass!

Signed-off-by: Michal Denar <black23@gmail.com>
Comment 4 Josef Moravec 2019-03-12 10:12:56 UTC
Created attachment 86509 [details] [review]
Bug 22454: Unit tests

Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 5 Josef Moravec 2019-03-12 10:12:59 UTC
Created attachment 86510 [details] [review]
Bug 22454: Add Koha::Item::hidden_in_opac method

This patch adds a hidden_in_opac method that does the same calculation
done in GetHiddenItemnumbers, but for a single item, and doesn't get the
OpacHiddenItems syspref, but expects them to be passed as parameters (to
avoid multiple reads).

To test:
- Apply this patches
- Run:
  $ kshell
 k$ prove t/db_dependent/Koha/Item.t
=> SUCCESS: Tests pass!

Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 6 Nick Clemens 2019-03-16 13:55:15 UTC
Awesome work all!

Pushed to master for 19.05
Comment 7 Martin Renvoize 2019-03-19 11:07:20 UTC
Enhancement will not be backported to 18.11.x series.