@@ -, +, @@ claimissues # 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 --- C4/Letters.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) --- a/C4/Letters.pm +++ a/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, --