From ddd7398713a393e1ade1cab80c8e757b3b02ce62 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 Signed-off-by: Kyle M Hall (cherry picked from commit 533640b07737ed1e3ecb9dced62672ab3376d7d4) Signed-off-by: Fridolin Somers --- 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 ea87d8b6c8..dbc7cb1e93 100755 --- a/tools/batch_delete_records.pl +++ b/tools/batch_delete_records.pl @@ -44,13 +44,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 d118120768..e972bcdf4d 100755 --- a/tools/batch_record_modification.pl +++ b/tools/batch_record_modification.pl @@ -81,6 +81,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