Bug 16935 - launch export_records.pl with deleted_barcodes param fails
authorFridolin Somers <fridolin.somers@biblibre.com>
Wed, 24 Aug 2016 09:44:55 +0000 (11:44 +0200)
committerFrédéric Demians <f.demians@tamil.fr>
Wed, 2 Nov 2016 18:24:42 +0000 (18:24 +0000)
commitb57fb0a9b20333ce52536b319342c2dd5021e3da
tree6c55772a6d8f01b3dce21cc3621f0113f5823020
parentdb1bf801e6ad9f9f051d51672a744179beb48bc8
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>
(cherry picked from commit dbab260afccc04fac8d088839d6017242c818917)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
misc/export_records.pl