From 57d12a6c8ef520265aa5772bec249bfcccb5caae Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 9 Oct 2025 13:02:22 +0100 Subject: [PATCH] Bug 40983: Complete deprecation of old after_biblio_action hook signature Content-Type: text/plain; charset=utf-8 This patch completes the deprecation cycle started in bug 36343 by removing the backward compatibility code and deprecation warnings for the old after_biblio_action hook signature. Changes made: 1. Removed the duplicate biblio and biblio_id parameters from _after_biblio_action_hooks in C4::Biblio that were marked for deprecation in 24.11.00 2. Updated the test plugin to use only the new payload-based signature, ensuring all parameters are accessed via $params->{payload} The after_biblio_action hook now consistently uses the modern signature with a payload parameter, matching the pattern used by other plugin hooks like before_biblio_action, after_item_action, and after_hold_action. Test plan: 1. Run: prove t/db_dependent/Koha/Plugins/Biblio_and_Items_plugin_hooks.t 2. Run: prove t/db_dependent/Koha/Plugins/ 3. Run: prove t/db_dependent/Biblio.t 4. All tests should pass Signed-off-by: Marcel de Rooy --- C4/Biblio.pm | 4 ---- t/lib/plugins/Koha/Plugin/Test.pm | 5 +++-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index c56d721003..a6e1230d92 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -3203,10 +3203,6 @@ sub _after_biblio_action_hooks { biblio => $biblio, biblio_id => $biblio_id, }, - - # NOTE: Deprecate these duplicate params for 24.11.00 - biblio => $biblio, - biblio_id => $biblio_id, } ); } diff --git a/t/lib/plugins/Koha/Plugin/Test.pm b/t/lib/plugins/Koha/Plugin/Test.pm index 46f0732dc6..4d6bd517f6 100644 --- a/t/lib/plugins/Koha/Plugin/Test.pm +++ b/t/lib/plugins/Koha/Plugin/Test.pm @@ -187,8 +187,9 @@ sub before_biblio_action { sub after_biblio_action { my ( $self, $params ) = @_; my $action = $params->{action} // ''; - my $biblio = $params->{biblio}; - my $biblio_id = $params->{biblio_id}; + my $payload = $params->{payload}; + my $biblio = $payload->{biblio}; + my $biblio_id = $payload->{biblio_id}; if ( $action ne 'delete' ) { Koha::Exception->throw( "after_biblio_action called with action: $action, ref: " . ref($biblio) ); -- 2.39.5