From 79b91ecbc17d4252dd11a26929c04524e8b27356 Mon Sep 17 00:00:00 2001 From: Josef Moravec Date: Fri, 22 Jun 2018 09:15:49 +0000 Subject: [PATCH] Bug 20271: (QA follow-up) Zebra should not index deleted record when doing full reindex Test plan: Run koha-rebuild-zebra -f [instance] --> without patch the deleted records are indexed and shown when searching --> with this patch the deleted records are not indexed Signed-off-by: Josef Moravec --- misc/migration_tools/rebuild_zebra.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/misc/migration_tools/rebuild_zebra.pl b/misc/migration_tools/rebuild_zebra.pl index c39ce63..15f4eba 100755 --- a/misc/migration_tools/rebuild_zebra.pl +++ b/misc/migration_tools/rebuild_zebra.pl @@ -480,7 +480,8 @@ sub select_all_biblios { $table = 'biblioitems' unless grep { /^$table$/ } @tables_allowed_for_select; my $strsth = qq{ SELECT biblionumber FROM $table }; - $strsth.=qq{ WHERE $where } if ($where); + $strsth.=qq{ WHERE $where AND deleted_on IS NULL} if ($where); + $strsth.=qq{ WHERE deleted_on IS NULL} unless ($where); $strsth.=qq{ LIMIT $length } if ($length && !$offset); $strsth.=qq{ LIMIT $offset,$length } if ($offset); my $sth = $dbh->prepare($strsth); -- 2.1.4