From bcdbc68d9a98277b86888c331cc46ca7fd3de635 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 Signed-off-by: Katrin Fischer --- 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 3647287f97..b4c8057d57 100644 --- a/Koha/Illrequest.pm +++ b/Koha/Illrequest.pm @@ -2083,10 +2083,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 430c3a68b3..32f7dedb48 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.39.5