Bug 22455

Summary: Add Koha::Biblio::hidden_in_opac method
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: jonathan.druart, josef.moravec, katrin.fischer, martin.renvoize, mtompset, nick, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 22454    
Bug Blocks:    
Attachments: Bug 22455: Unit tests
Bug 22455: Add Koha::Biblio::hidden_in_opac method
Bug 22455: Unit tests
Bug 22455: Add Koha::Biblio::hidden_in_opac method
Bug 22455: Unit tests
Bug 22455: Add Koha::Biblio::hidden_in_opac method

Description Tomás Cohen Arazi 2019-03-05 13:59:29 UTC
We need such a method to determine if a biblio 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 14:05:01 UTC
Created attachment 86066 [details] [review]
Bug 22455: Unit tests
Comment 2 Tomás Cohen Arazi 2019-03-05 14:05:09 UTC
Created attachment 86067 [details] [review]
Bug 22455: Add Koha::Biblio::hidden_in_opac method

This patch adds a hidden_in_opac method that does the same calculation
done in places like opac-tags.pl. The condition that is checked is that
all items belonging to the biblio are hidden. This is the current
behaviour in the code.

To test:
- Apply this patches
- Run:
  $ kshell
 k$ prove t/db_dependent/Koha/Biblio.t
=> SUCCESS: Tests pass!
Comment 3 Michal Denar 2019-03-12 09:07:04 UTC
Created attachment 86502 [details] [review]
Bug 22455: Unit tests

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

Signed-off-by: Michal Denar <black23@gmail.com>
Comment 4 Michal Denar 2019-03-12 09:07:26 UTC
Created attachment 86503 [details] [review]
Bug 22455: Add Koha::Biblio::hidden_in_opac method

This patch adds a hidden_in_opac method that does the same calculation
done in places like opac-tags.pl. The condition that is checked is that
all items belonging to the biblio are hidden. This is the current
behaviour in the code.

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

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

Signed-off-by: Michal Denar <black23@gmail.com>
Comment 5 Josef Moravec 2019-03-12 10:18:14 UTC
Created attachment 86511 [details] [review]
Bug 22455: Unit tests

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

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 6 Josef Moravec 2019-03-12 10:18:17 UTC
Created attachment 86512 [details] [review]
Bug 22455: Add Koha::Biblio::hidden_in_opac method

This patch adds a hidden_in_opac method that does the same calculation
done in places like opac-tags.pl. The condition that is checked is that
all items belonging to the biblio are hidden. This is the current
behaviour in the code.

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

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

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

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