Bugzilla – Attachment 113047 Details for
Bug 26935
Incorrect basketid sent for claimacquisition and claimissues
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26935: Don't use basket for claimacquisition and claimissues
Bug-26935-Dont-use-basket-for-claimacquisition-and.patch (text/plain), 2.96 KB, created by
Martin Renvoize (ashimema)
on 2020-11-05 09:21:51 UTC
(
hide
)
Description:
Bug 26935: Don't use basket for claimacquisition and claimissues
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-11-05 09:21:51 UTC
Size:
2.96 KB
patch
obsolete
>From 07e95681d4f5314cf2df2950ead4d199d8497a0f Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 5 Nov 2020 09:12:12 +0100 >Subject: [PATCH] Bug 26935: Don't use basket for claimacquisition and > claimissues > >Incorrect basketid is sent for claimacquisition and claimissues. > >The basket info are not used in the default template of these notices, but if it >is used, a wrong basket may be passed to generate the notice. > >This has been caught by a test failure after bug 26745. > > # Failed test 'SendAlerts - claimissue' > # at t/db_dependent/Letters.t line 642. > C4::Letters::_substitute_tables(): DBI Exception: DBD::mysql::st execute failed: called with 2 bind variables when 1 are needed [for Statement "SELECT * FROM aqbasket WHERE basketno = ?" with ParamValues: 0=53] at /kohadevbox/koha/C4/Letters.pm line 679 > >This is a quick patch to fix the failing test, bug more work would needed. > >We are removing the basket info from those 2 notices and keeping it only >for orderacquisition. > >Technically: the $externalid is coming from the parameter list of >SendAlerts, but it is a basketno only for orderacquisition. We must not >pass it for other notices. > >Test plan: >Confirm that the failing test is now passing and that the changes make >sense. > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > C4/Letters.pm | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > >diff --git a/C4/Letters.pm b/C4/Letters.pm >index cacd846e98..cd0c651f03 100644 >--- a/C4/Letters.pm >+++ b/C4/Letters.pm >@@ -373,6 +373,7 @@ sub SendAlerts { > my $sthorders; > my $dataorders; > my $action; >+ my $basketno; > if ( $type eq 'claimacquisition') { > $strsth = qq{ > SELECT aqorders.*,aqbasket.*,biblio.*,biblioitems.* >@@ -419,6 +420,7 @@ sub SendAlerts { > } > > if ( $type eq 'orderacquisition') { >+ my $basketno = $externalid; > $strsth = qq{ > SELECT aqorders.*,aqbasket.*,biblio.*,biblioitems.* > FROM aqorders >@@ -429,13 +431,13 @@ sub SendAlerts { > AND orderstatus IN ('new','ordered') > }; > >- if (!$externalid){ >+ unless ( $basketno ) { > carp "No basketnumber given"; > return { error => "no_basketno" }; > } > $action = "ACQUISITION ORDER"; > $sthorders = $dbh->prepare($strsth); >- $sthorders->execute($externalid); >+ $sthorders->execute($basketno); > $dataorders = $sthorders->fetchall_arrayref( {} ); > } > >@@ -472,7 +474,7 @@ sub SendAlerts { > 'branches' => $userenv->{branch}, > 'aqbooksellers' => $databookseller, > 'aqcontacts' => $datacontact, >- 'aqbasket' => $externalid, >+ 'aqbasket' => $basketno, > }, > repeat => $dataorders, > want_librarian => 1, >-- >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 26935
:
113033
|
113047
|
113118