Bug 35782: Replace TT plugin's method Biblio::HoldsCount
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 12 Jan 2024 07:44:12 +0000 (08:44 +0100)
committerKatrin Fischer <katrin.fischer@bsz-bw.de>
Fri, 15 Mar 2024 08:38:39 +0000 (09:38 +0100)
commit06c09e15fd23fc9db2b99392e263e6d233339c15
treecbdaa559cbeabf9072b29373e6de75e4c9098024
parent638b5ef1b4a02b97c14b6166b1db7c4701fb741b
Bug 35782: Replace TT plugin's method Biblio::HoldsCount

We can use biblio.holds.count instead.

The main idea here is to make sure we are passing a Koha::Biblio object
as 'biblio' to all the templates including biblio-view-menu.inc

Test plan:
1. Go to the biblio detail view, click on the different entries in the menu
on the left. Confirm that the "Holds" tab always has the correct number
of Holds display in the parenthesis.

2. Run a search and confirm that the number of holds are still displayed
for each result.

QA:
git grep biblio-view-menu.inc
notice the tt list, open the corresponding perl controllers and confirm
that 'biblio' is passed and that it is a Koha::Biblio object.
The only missing place I found was in viewlog.
Note that we are not removing the TT method yet, we are marking it as
deprecated and also display a warning during the update DB process in
case one of the notice templates is using it.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Koha/Template/Plugin/Biblio.pm
installer/data/mysql/atomicupdate/bug_35782.pl [new file with mode: 0755]
koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt
koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt
tools/viewlog.pl