From f370fb58458add6b4fc12af78eb3fd559ed176a7 Mon Sep 17 00:00:00 2001 From: Sophie Meynieux Date: Sun, 10 Jun 2012 12:23:20 +0200 Subject: [PATCH] Bug 7329 [Followup] : when reverting an import, keep matching biblionumber in batch table, if items are not deleted beacause on loan. Signed-off-by: Katrin Fischer Signed-off-by: Chris Cormack (cherry picked from commit 45784a7183095bc9bbe4761fd26e385386d822d1) Signed-off-by: Jared Camins-Esakov --- C4/ImportBatch.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/ImportBatch.pm b/C4/ImportBatch.pm index 64c8c8a97b..9aad8c4383 100644 --- a/C4/ImportBatch.pm +++ b/C4/ImportBatch.pm @@ -616,7 +616,7 @@ sub BatchRevertBibRecords { $num_items_deleted += BatchRevertItems($rowref->{'import_record_id'}, $rowref->{'matched_biblionumber'}); SetImportRecordStatus($rowref->{'import_record_id'}, 'reverted'); } - my $sth2 = $dbh->prepare_cached("UPDATE import_biblios SET matched_biblionumber = NULL WHERE import_record_id = ?"); + my $sth2 = $dbh->prepare_cached("UPDATE import_biblios LEFT JOIN import_items USING (import_record_id) SET matched_biblionumber = NULL WHERE import_record_id = ? AND status != 'imported'" ); $sth2->execute($rowref->{'import_record_id'}); } -- 2.39.5