From b2b0eaed0f4a29fff741c416db8fe783b6e415c8 Mon Sep 17 00:00:00 2001 From: David Gustafsson Date: Thu, 14 Feb 2019 15:59:27 +0100 Subject: [PATCH] Bug 21872: Remove duplicate modulo condition in authorities iterator Signed-off-by: Josef Moravec --- Koha/BiblioUtils.pm | 2 +- Koha/MetadataRecord/Authority.pm | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Koha/BiblioUtils.pm b/Koha/BiblioUtils.pm index 88395a952f..fd6969d8bf 100644 --- a/Koha/BiblioUtils.pm +++ b/Koha/BiblioUtils.pm @@ -131,7 +131,7 @@ sub get_all_biblios_iterator { if ($options{slice}) { $slice_count = $options{slice}->{count}; $slice_modulo = $options{slice}->{index}; - $search_terms = \[ ' mod(biblionumber, ?) = ?', $slice_count, $slice_modulo]; + $search_terms = \[ 'mod(biblionumber, ?) = ?', $slice_count, $slice_modulo ]; } my $database = Koha::Database->new(); diff --git a/Koha/MetadataRecord/Authority.pm b/Koha/MetadataRecord/Authority.pm index 48aa7aefa9..cedbcae30d 100644 --- a/Koha/MetadataRecord/Authority.pm +++ b/Koha/MetadataRecord/Authority.pm @@ -182,11 +182,10 @@ sub get_all_authorities_iterator { if ($options{slice}) { $slice_count = $options{slice}->{count}; $slice_modulo = $options{slice}->{index}; - $search_terms->{authid} = \[ ' mod ? = ?', $slice_count, $slice_modulo]; $search_terms = { '-and' => [ - $search_terms, - \[ ' mod(authid, ?) = ?', $slice_count, $slice_modulo] + %{$search_terms}, + \[ 'mod(authid, ?) = ?', $slice_count, $slice_modulo ] ] }; } -- 2.11.0