Bug 18611 - Create labels action fails in manage-marc-import.pl if an item has been...
authorNick Clemens <nick@bywatersolutions.com>
Tue, 16 May 2017 09:40:28 +0000 (05:40 -0400)
committerKyle M Hall <kyle@bywatersolutions.com>
Mon, 29 May 2017 02:23:34 +0000 (22:23 -0400)
To test:
1 - Import a batch with some items
2 - Delete one of the imported items
3 - Browse to Tools->Staged MARC record management
4 - Click (Create label batch) for the batch you imported
5 - Recieve an error
6 - Apply patch
7 - Click (Create label batch)
8 - Batch is created with remaning items from the import

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

C4/ImportBatch.pm

index a4f4c55..f78299d 100644 (file)
@@ -1059,7 +1059,7 @@ sub GetImportBatchRangeDesc {
 sub GetItemNumbersFromImportBatch {
        my ($batch_id) = @_;
        my $dbh = C4::Context->dbh;
-       my $sth = $dbh->prepare("SELECT itemnumber FROM import_batches,import_records,import_items WHERE import_batches.import_batch_id=import_records.import_batch_id AND import_records.import_record_id=import_items.import_record_id AND import_batches.import_batch_id=?");
+    my $sth = $dbh->prepare("SELECT items.itemnumber FROM import_batches,import_records,import_items, items WHERE import_batches.import_batch_id=import_records.import_batch_id AND import_records.import_record_id=import_items.import_record_id AND items.itemnumber=import_items.itemnumber AND import_batches.import_batch_id=?");
        $sth->execute($batch_id);
        my @items ;
        while ( my ($itm) = $sth->fetchrow_array ) {