From af62a976376e7a478053ee73bb106509eb0e6461 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 28 Jan 2021 18:56:39 +0000 Subject: [PATCH] Bug 26298: Don't set too_many_items_to_process if equal to limit In the code we prepare items for display if less than or equal to the pref, but we don't allow the edit if greater than or equal to the pref. The second case should be only 'greater than' To test: 1- Set MaxItemsToProcessForBatchMod to 1000 2- Go to Reports 3- Make a report for itemnumbers that will give you at least 1000 items (ex. SELECT itemnumber FROM items) 4- Save and run the report 5- In "Rows per page", choose 1000 6- Click on "Batch operations with 1000 visible records" > Batch item modification 7- Notice that the item modification form isn't there and that the message says "Too many items (1000): You are not allowed to edit more than 1000 items in a batch." 8- Apply patch 9- Restart all the things 10- Run the report again and display 1000 rows 11- Click on "Batch operations with 1000 visible records" > Batch item modification 12 - Sucess! Signed-off-by: Barbara Johnson Signed-off-by: Marcel de Rooy Signed-off-by: Jonathan Druart (cherry picked from commit ae76d7626b0a23830b0269c00cbc2be73720d9ec) Signed-off-by: Fridolin Somers (cherry picked from commit 7a8a166bd1e5a55062857a481bb543b0450cf2e1) Signed-off-by: Andrew Fuerste-Henry (cherry picked from commit f83f0f75c27e1f4a3ccea8fb69036133031aaaf9) Signed-off-by: Victor Grousset/tuxayo --- tools/batchMod.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/batchMod.pl b/tools/batchMod.pl index 4e27d47237..b6a47fa976 100755 --- a/tools/batchMod.pl +++ b/tools/batchMod.pl @@ -295,7 +295,7 @@ if ($op eq "show"){ my $max_display_items = $del ? C4::Context->preference("MaxItemsToDisplayForBatchDel") : C4::Context->preference("MaxItemsToDisplayForBatchMod"); - $template->param("too_many_items_process" => scalar(@itemnumbers)) if !$del && scalar(@itemnumbers) >= C4::Context->preference("MaxItemsToProcessForBatchMod"); + $template->param("too_many_items_process" => scalar(@itemnumbers)) if !$del && scalar(@itemnumbers) > C4::Context->preference("MaxItemsToProcessForBatchMod"); if (scalar(@itemnumbers) <= ( $max_display_items // 1000 ) ) { $items_display_hashref=BuildItemsData(@itemnumbers); } else { -- 2.39.5