From 2096876b36e466becf589cc9433822a57db379a8 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 25 Aug 2016 14:59:12 +0100 Subject: [PATCH] Bug 17196: Update misc/maintenance/sanitize_records.pl Test plan: Use the sanitize_records.pl maintenance script with the --auto-search option Signed-off-by: Mason James Signed-off-by: Josef Moravec Signed-off-by: Zeno Tajoli Signed-off-by: Nick Clemens Signed-off-by: Marcel de Rooy Signed-off-by: Kyle M Hall --- misc/maintenance/sanitize_records.pl | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/misc/maintenance/sanitize_records.pl b/misc/maintenance/sanitize_records.pl index b9caa4bfb7..f91daddad1 100755 --- a/misc/maintenance/sanitize_records.pl +++ b/misc/maintenance/sanitize_records.pl @@ -150,11 +150,12 @@ sub biblios_to_sanitize { my $dbh = C4::Context->dbh; my $query = q{ SELECT biblionumber - FROM biblioitems - WHERE marcxml - LIKE "%&amp;%" - }; - return @{ $dbh->selectcol_arrayref( $query, { Slice => {} }, ) }; + FROM biblio_metadata + WHERE format = 'marcxml' + AND marcflavour = ? + AND metadata LIKE "%&amp;%" + }; + return @{ $dbh->selectcol_arrayref( $query, { Slice => {} }, C4::Context->preference('marcflavour') ) }; } =head1 NAME @@ -194,7 +195,7 @@ commas. Give a biblionumber list using a filename. One biblionumber by line or separate them with a whitespace character. -=item B<--auto_search> +=item B<--auto-search> Automatically search records containing "&" in biblioitems.marcxml or in the specified fields. -- 2.39.5