diff --git a/Koha/Template/Plugin/Biblio.pm b/Koha/Template/Plugin/Biblio.pm index 79c7284292..d23eb094b6 100644 --- a/Koha/Template/Plugin/Biblio.pm +++ b/Koha/Template/Plugin/Biblio.pm @@ -31,9 +31,12 @@ use Koha::Recalls; use Koha::DateUtils qw(dt_from_string); +# Do not use HoldsCount, it is deprecated and will be removed in a future release. sub HoldsCount { my ( $self, $biblionumber ) = @_; + warn "HoldsCount is deprecated, you should use biblio.holds.count instead"; + my $holds = Koha::Holds->search( { biblionumber => $biblionumber } ); return $holds->count(); diff --git a/installer/data/mysql/atomicupdate/bug_35782.pl b/installer/data/mysql/atomicupdate/bug_35782.pl new file mode 100755 index 0000000000..9ade6166a9 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_35782.pl @@ -0,0 +1,25 @@ +use Modern::Perl; + +return { + bug_number => "35872", + description => "Biblio.HoldsCount is deprecated", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + # Do you stuffs here + my ($count) = $dbh->selectrow_array( + q{ + SELECT COUNT(*) + FROM letter + WHERE content LIKE "%Biblio.HoldsCount%"; + } + ); + + if ($count) { + say $out "WARNING - Biblio.HoldsCount is used in at least one notice template"; + say $out "It is deprecated and will be remove in a future version of Koha."; + say $out "Replace it with biblio.holds.count instead"; + } + }, +}; diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc index 7d3aee9462..c7fbc727e8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc @@ -1,6 +1,6 @@ [% USE Koha %] [% USE Biblio %] -[% SET biblio_object_id = object || biblionumber || biblio.biblionumber %] +[% SET biblio_object_id = biblio.biblionumber %]