From 30a526d635b916e343e074d3074adc2cc894d135 Mon Sep 17 00:00:00 2001 From: Christophe Croullebois Date: Fri, 7 Dec 2012 15:26:21 +0100 Subject: [PATCH] Bug 9243: Bad delete order in sub index-records If we have in the zebraqueue table for the same record, one line "update" and another "delete", the index_records sub in rebuild_zebra.pl treats the delete line first. The result is that the record still exists in zebra. Signed-off-by: Kyle M Hall http://bugs.koha-community.org/show_bug.cgi?id=9252 --- misc/migration_tools/rebuild_zebra.pl | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/misc/migration_tools/rebuild_zebra.pl b/misc/migration_tools/rebuild_zebra.pl index a46526d..2e2bbf5 100755 --- a/misc/migration_tools/rebuild_zebra.pl +++ b/misc/migration_tools/rebuild_zebra.pl @@ -232,15 +232,15 @@ sub index_records { mkdir "$directory" unless (-d $directory); mkdir "$directory/$record_type" unless (-d "$directory/$record_type"); if ($process_zebraqueue) { - my $entries = select_zebraqueue_records($record_type, 'deleted'); - mkdir "$directory/del_$record_type" unless (-d "$directory/del_$record_type"); - $records_deleted = generate_deleted_marc_records($record_type, $entries, "$directory/del_$record_type", $as_xml); - mark_zebraqueue_batch_done($entries); - $entries = select_zebraqueue_records($record_type, 'updated'); + my $entries = select_zebraqueue_records($record_type, 'updated'); mkdir "$directory/upd_$record_type" unless (-d "$directory/upd_$record_type"); $num_records_exported = export_marc_records_from_list($record_type, $entries, "$directory/upd_$record_type", $as_xml, $noxml, $records_deleted); mark_zebraqueue_batch_done($entries); + $entries = select_zebraqueue_records($record_type, 'deleted'); + mkdir "$directory/del_$record_type" unless (-d "$directory/del_$record_type"); + $records_deleted = generate_deleted_marc_records($record_type, $entries, "$directory/del_$record_type", $as_xml); + mark_zebraqueue_batch_done($entries); } else { my $sth = select_all_records($record_type); $num_records_exported = export_marc_records_from_sth($record_type, $sth, "$directory/$record_type", $as_xml, $noxml, $nosanitize); -- 1.7.2.5