From 9468d8195f72825d809ab75a74c315d566ffc1b8 Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Mon, 9 Aug 2021 23:14:03 -1000 Subject: [PATCH] Bug 28835: Fix ability to pass list contents to batch record modification Bug 12759 added the ability to pass list contents to batch record modification/deletion tools. Patch Bug 22417 [Restore the 'add to list' feature] removed the fetch of lists in batch_record_modification.pl I don't understand why. It still exists in batch_delete_records.pl. Note that this is needed when first form is displayed. Test plan : 1) Create a private and a public list of records 2) Open Tools > Batch record modification 3) Check you can use the lists 4) Open Tools > Batch record deletion 5) Check you can use the lists Signed-off-by: Lucas Gass Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart --- tools/batch_delete_records.pl | 12 +++++++++--- tools/batch_record_modification.pl | 6 ++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/tools/batch_delete_records.pl b/tools/batch_delete_records.pl index 00c8fd107a..424c8611ab 100755 --- a/tools/batch_delete_records.pl +++ b/tools/batch_delete_records.pl @@ -45,13 +45,19 @@ my ($template, $loggedinuser, $cookie) = get_template_and_user({ flagsrequired => { tools => 'records_batchdel' }, }); -$template->param( lists => scalar Koha::Virtualshelves->search([{ category => 1, owner => $loggedinuser }, { category => 2 }]) ); - my @records; my @messages; if ( $op eq 'form' ) { # Display the form - $template->param( op => 'form' ); + $template->param( + op => 'form', + lists => scalar Koha::Virtualshelves->search( + [ + { category => 1, owner => $loggedinuser }, + { category => 2 } + ] + ) + ); } elsif ( $op eq 'list' ) { # List all records to process my @record_ids; diff --git a/tools/batch_record_modification.pl b/tools/batch_record_modification.pl index 31231e77c2..3ffc18d524 100755 --- a/tools/batch_record_modification.pl +++ b/tools/batch_record_modification.pl @@ -82,6 +82,12 @@ if ( $op eq 'form' ) { # Display the form $template->param( view => 'form', + lists => scalar Koha::Virtualshelves->search( + [ + { category => 1, owner => $loggedinuser }, + { category => 2 } + ] + ) ); } elsif ( $op eq 'list' ) { # List all records to process -- 2.39.5