From e1abe2960976e2a173b9dc22be077201dedf811b Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Wed, 15 Nov 2023 15:26:33 +0000 Subject: [PATCH] Bug 35331: (QA follow-up): Avoid code pattern iterating on plugin responses (see bug 28010) Use plugin call pattern established in bug 28211. Please utilize version 1.0.1 of the plugin to test this follow-up: https://github.com/PTFS-Europe/koha-plugin-ill-actions/releases/tag/v1.0.1 Signed-off-by: David Nind Signed-off-by: Kyle M Hall --- Koha/Illrequest.pm | 5 +---- t/lib/plugins/Koha/Plugin/Test.pm | 17 ++++++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Koha/Illrequest.pm b/Koha/Illrequest.pm index 2f7231dbc8e..273fcaa9179 100644 --- a/Koha/Illrequest.pm +++ b/Koha/Illrequest.pm @@ -2145,10 +2145,7 @@ sub get_staff_table_actions { } ]; - my @plugin_responses = Koha::Plugins->call('ill_table_actions'); - for my $plugin_variables (@plugin_responses) { - push( @{$ill_table_actions}, $plugin_variables ); - } + Koha::Plugins->call( 'ill_table_actions', \$ill_table_actions ); return $ill_table_actions; } diff --git a/t/lib/plugins/Koha/Plugin/Test.pm b/t/lib/plugins/Koha/Plugin/Test.pm index 430c3a68b3a..32f7dedb489 100644 --- a/t/lib/plugins/Koha/Plugin/Test.pm +++ b/t/lib/plugins/Koha/Plugin/Test.pm @@ -378,14 +378,17 @@ sub template_include_paths { } sub ill_table_actions { - my ( $self ) = @_; + my ( $self, $table_actions ) = @_; - return { - button_link_text => 'Test text', - append_column_data_to_link => 1, - button_class => 'test class', - button_link => 'test link' - }; + push( + @{$$table_actions}, + { + button_link_text => 'Test text', + append_column_data_to_link => 1, + button_class => 'test class', + button_link => 'test link' + } + ); } sub _private_sub { -- 2.30.2