]> git.koha-community.org Git - koha.git/commit
Bug 28478: Make opac-*detail.pl scripts use Koha::Biblio->opac_suppressed()
authorTomas Cohen Arazi <tomascohen@theke.io>
Wed, 18 Dec 2024 14:15:36 +0000 (11:15 -0300)
committerFridolin Somers <fridolin.somers@biblibre.com>
Wed, 26 Feb 2025 12:53:14 +0000 (13:53 +0100)
commitae442f2de8ffaaf4d45abd2e8b5c4b6a517b9b58
tree77c58fb179a453e3b54afade46dc7966de1b6136
parent55821c5558a68fdb571327bfdc4b4dd5f1d4f2a8
Bug 28478: Make opac-*detail.pl scripts use Koha::Biblio->opac_suppressed()

This patch makes the following scripts use the new method for checking
suppression:

* opac/opac-ISBDdetail.pl
* opac/opac-MARCdetail.pl
* opac/opac-detail.pl

In the `opac-detail.pl` case, it is a simple change by removing MARC
data traversal in favor of the new method. The code checking
suppression gets moved up so we don't process or make any other
calculations if the record is suppressed.

The other two scripts where completely missing the check and thus
leaking suppressed records.

To test:
1. Pick two records, one marked as suppressed, and the other not
   suppressed.
2. Try acessing them in the OPAC detail page.
=> SUCCESS: Suppressed records are suppressed, and not suppressed ones
are not.
3. Try the same records on the ISBD and MARC view
=> FAIL: They are not suppressed!
4. Apply this patch
5. Repeat 2
=> SUCCESS: Suppression is still respected
6. Repeat 3
=> SUCCESS: Suppression is respected on the ISBD and MARC views
7. Sign off :-D

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Works as advertised. Remember to activate OPAC suppression with
OpacSuppression.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
(cherry picked from commit 5b775aee691268a17bdf39739e0db83eb269116c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
opac/opac-ISBDdetail.pl
opac/opac-MARCdetail.pl
opac/opac-detail.pl