From 0f73c9176890675ba0630ebb51657d16a865c8ad 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 Signed-off-by: Martin Renvoize Signed-off-by: Nick Clemens --- 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 3a188e7384..17245f0cf4 100644 --- a/Koha/MetadataRecord/Authority.pm +++ b/Koha/MetadataRecord/Authority.pm @@ -183,11 +183,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.39.5