Bug 16935 - launch export_records.pl with deleted_barcodes param fails
When launching misc/export_records.pl with this command line :
misc/export_records.pl --date=`date +%d/%m/%Y` --deleted_barcodes --filename=/tmp/koha.mrc
You get this error message :
DBD::mysql::db selectall_arrayref failed: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 4 [for Statement " (
SELECT DISTINCT barcode
FROM deleteditems
WHERE deleteditems.biblionumber = ?
"] at misc/export_records.pl line 189.
This is because of a '(' after 'q|', looks like a typo.
Also, this patch removes useless var $q.
Test plan :
- Delete an item with barcode
- Without patch, run : misc/export_records.pl --date=`date +%d/%m/%Y` --deleted_barcodes --filename=/tmp/koha.mrc
=> You get dirty MySQL
- Without patch, run the same command
=> No error and the file is generated
Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
parent
5d5a1509d1
commit
dbab260afc
|
|
@ -184,14 +184,12 @@ if ( @record_ids and $id_list_file ) {
|
|||
|
||||
if ($deleted_barcodes) {
|
||||
for my $record_id ( @record_ids ) {
|
||||
my $q = q|
|
||||
|;
|
||||
my $barcode = $dbh->selectall_arrayref(q| (
|
||||
my $barcode = $dbh->selectall_arrayref(q|
|
||||
SELECT DISTINCT barcode
|
||||
FROM deleteditems
|
||||
WHERE deleteditems.biblionumber = ?
|
||||
|, { Slice => {} }, $record_id );
|
||||
say $_->{barcode} for @$barcode
|
||||
say $_->{barcode} for @$barcode;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue