Bugzilla – Attachment 160963 Details for
Bug 35783
Remove Koha::Template::Plugin::Biblio::RecallsCount
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35783: Replace TT plugin's method Biblio::RecallsCount
Bug-35783-Replace-TT-plugins-method-BiblioRecallsC.patch (text/plain), 4.59 KB, created by
Kyle M Hall (khall)
on 2024-01-12 13:41:10 UTC
(
hide
)
Description:
Bug 35783: Replace TT plugin's method Biblio::RecallsCount
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2024-01-12 13:41:10 UTC
Size:
4.59 KB
patch
obsolete
>From 966e8a3ee8b526b08a3ecb3e1b0cb46ffd6acc08 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 12 Jan 2024 09:41:21 +0100 >Subject: [PATCH] Bug 35783: Replace TT plugin's method Biblio::RecallsCount > >We can use biblio.recalls.search( completed => 0 ).count instead. > >Test plan: >1. Go to the biblio detail view, click on the different entries in the menu >on the left. Confirm that the "Recalls" tab always has the correct number >of current recalls display in the parenthesis. > >2. Run a search and confirm that the number of current recalls are still displayed >for each result. > >Signed-off-by: David Nind <david@davidnind.com> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > Koha/Template/Plugin/Biblio.pm | 1 + > .../data/mysql/atomicupdate/bug_35783.pl | 25 +++++++++++++++++++ > .../prog/en/includes/biblio-view-menu.inc | 2 +- > .../prog/en/modules/catalogue/results.tt | 2 +- > 4 files changed, 28 insertions(+), 2 deletions(-) > create mode 100755 installer/data/mysql/atomicupdate/bug_35783.pl > >diff --git a/Koha/Template/Plugin/Biblio.pm b/Koha/Template/Plugin/Biblio.pm >index 79c7284292f..65def01e512 100644 >--- a/Koha/Template/Plugin/Biblio.pm >+++ b/Koha/Template/Plugin/Biblio.pm >@@ -60,6 +60,7 @@ sub CanArticleRequest { > return $biblio ? $biblio->can_article_request( $borrower ) : 0; > } > >+# Do not use RecallsCount, it is deprecated and will be removed in a future release. > sub RecallsCount { > my ( $self, $biblionumber ) = @_; > >diff --git a/installer/data/mysql/atomicupdate/bug_35783.pl b/installer/data/mysql/atomicupdate/bug_35783.pl >new file mode 100755 >index 00000000000..0fd7d9be5e2 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_35783.pl >@@ -0,0 +1,25 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "35873", >+ description => "Biblio.RecallsCount 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.RecallsCount%"; >+ } >+ ); >+ >+ if ($count) { >+ say $out "WARNING - Biblio.RecallsCount 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.recalls.search( completed => 0 ).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 7d3aee94621..456e06289a0 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 >@@ -130,7 +130,7 @@ > [%- ELSE -%] > <li> > [%- END -%] >- <a href="/cgi-bin/koha/recalls/request.pl?biblionumber=[% biblio_object_id | url %]">Recalls ([% Biblio.RecallsCount( biblio_object_id ) | html %])</a> >+ <a href="/cgi-bin/koha/recalls/request.pl?biblionumber=[% biblio_object_id | url %]">Recalls ([% biblio.recalls.search( completed => 0 ).count | html %])</a> > </li> > [%- END -%] > </ul> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >index b6966286d43..c8dacbaeee9 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >@@ -570,7 +570,7 @@ > [% END %] > [% END # /IF SEARCH_RESULT.norequests %] > [% IF Koha.Preference('UseRecalls') and CAN_user_recalls %] >- | <a id="recall_[% SEARCH_RESULT.biblionumber | html %]" href="/cgi-bin/koha/recalls/request.pl?biblionumber=[% SEARCH_RESULT.biblionumber | html %]">Recalls ([% Biblio.RecallsCount( SEARCH_RESULT.biblionumber ) | html %])</a> >+ | <a id="recall_[% SEARCH_RESULT.biblionumber | html %]" href="/cgi-bin/koha/recalls/request.pl?biblionumber=[% SEARCH_RESULT.biblionumber | html %]">Recalls ([% SEARCH_RESULT.biblio_object.recalls.search( completed => 0 ).count | html %])</a> > [% END %] > > [% IF Koha.Preference('intranetbookbag') == 1 %] >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 35783
:
160899
|
160931
|
160934
| 160963