Bugzilla – Attachment 127143 Details for
Bug 29380
Auto renewing, batch due date extension tool and checkout note previews are broken
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29380: Correct table name in joins to prevent errors
Bug-29380-Correct-table-name-in-joins-to-prevent-e.patch (text/plain), 3.25 KB, created by
Martin Renvoize (ashimema)
on 2021-11-01 08:16:20 UTC
(
hide
)
Description:
Bug 29380: Correct table name in joins to prevent errors
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-11-01 08:16:20 UTC
Size:
3.25 KB
patch
obsolete
>From 3209af5d47dc51706cd9e81158d7bab1024e06ae Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Joonas=20Kylm=C3=A4l=C3=A4?= <joonas.kylmala@iki.fi> >Date: Sat, 30 Oct 2021 19:02:39 +0000 >Subject: [PATCH] Bug 29380: Correct table name in joins to prevent errors > >The commit "Bug 29290: Rename relationships borrower => >patron" (d46492ac23) renamed the relation for the borrowers table from >'borrower' to 'patron' but the joins were not updated accordingly so a >few scripts got broken. > >To test: > 1) Notice that > $ perl misc/cronjobs/automatic_renewals.pl -c -s -v > returns 255 error code on exit > 2) Apply patch > 3) Notice the automatic_renewals.pl works now and exit code is 0 > 4) Make sure /cgi-bin/koha/tools/batch_extend_due_dates.pl works. > 5) Try to grep for 'borrower' in Koha source code and see if there > are any other join done using the Koha::Checkout or > Koha::Old::Checkout objects. > >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > circ/checkout-notes.pl | 2 +- > misc/cronjobs/automatic_renewals.pl | 2 +- > tools/batch_extend_due_dates.pl | 4 ++-- > 3 files changed, 4 insertions(+), 4 deletions(-) > >diff --git a/circ/checkout-notes.pl b/circ/checkout-notes.pl >index e94bea06c9..9f5e1c7bdf 100755 >--- a/circ/checkout-notes.pl >+++ b/circ/checkout-notes.pl >@@ -56,7 +56,7 @@ if ( $action eq 'seen' ) { > } > } > >-my $notes = Koha::Checkouts->search({ 'me.note' => { '!=', undef } }, { prefetch => [ 'borrower', { item => 'biblionumber' } ] }); >+my $notes = Koha::Checkouts->search({ 'me.note' => { '!=', undef } }, { prefetch => [ 'patron', { item => 'biblionumber' } ] }); > $template->param( > selected_count => scalar(@issue_ids), > action => $action, >diff --git a/misc/cronjobs/automatic_renewals.pl b/misc/cronjobs/automatic_renewals.pl >index cb45e68cbd..172a8ff14a 100755 >--- a/misc/cronjobs/automatic_renewals.pl >+++ b/misc/cronjobs/automatic_renewals.pl >@@ -132,7 +132,7 @@ $verbose = 1 unless $verbose or $confirm; > print "Test run only\n" unless $confirm; > > print "getting auto renewals\n" if $verbose; >-my $auto_renews = Koha::Checkouts->search({ auto_renew => 1, 'borrower.autorenew_checkouts' => 1 },{ join => 'borrower'}); >+my $auto_renews = Koha::Checkouts->search({ auto_renew => 1, 'patron.autorenew_checkouts' => 1 },{ join => 'patron'}); > print "found " . $auto_renews->count . " auto renewals\n" if $verbose; > > my $renew_digest = {}; >diff --git a/tools/batch_extend_due_dates.pl b/tools/batch_extend_due_dates.pl >index 77c80237ab..1ce79eeb68 100755 >--- a/tools/batch_extend_due_dates.pl >+++ b/tools/batch_extend_due_dates.pl >@@ -59,7 +59,7 @@ elsif ( $op eq 'list' ) { > my $dtf = Koha::Database->new->schema->storage->datetime_parser; > my $search_params; > if (@categorycodes) { >- $search_params->{'borrower.categorycode'} = { -in => \@categorycodes }; >+ $search_params->{'patron.categorycode'} = { -in => \@categorycodes }; > } > if (@branchcodes) { > $search_params->{'me.branchcode'} = { -in => \@branchcodes }; >@@ -98,7 +98,7 @@ elsif ( $op eq 'list' ) { > my $checkouts = Koha::Checkouts->search( > $search_params, > { >- join => [ 'item', 'borrower' ] >+ join => [ 'item', 'patron' ] > } > ); > >-- >2.20.1
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 29380
:
127109
|
127126
| 127143 |
127226