Bug 40983 - Remove deprecated syntax for 'after_biblio_action' hooks
Summary: Remove deprecated syntax for 'after_biblio_action' hooks
Status: Passed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Plugin architecture (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Martin Renvoize (ashimema)
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on: 36343
Blocks:
  Show dependency treegraph
 
Reported: 2025-10-09 11:37 UTC by Martin Renvoize (ashimema)
Modified: 2025-10-10 06:52 UTC (History)
2 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
IMPORTANT: The former biblio and biblio_id params of after_biblio_action hooks/plugins have been removed now. They were deprecated on bug 36343 and replaced by the payload hash. Please adjust your plugins using them, if you did not do so already.
Version(s) released in:
Circulation function:


Attachments
Bug 40983: Complete deprecation of old after_biblio_action hook signature (2.39 KB, patch)
2025-10-09 12:03 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 40983: Complete deprecation of old after_biblio_action hook signature (2.48 KB, patch)
2025-10-10 06:52 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 40983: (QA follow-up) Add a (final) upgrade warn (1.36 KB, patch)
2025-10-10 06:52 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Renvoize (ashimema) 2025-10-09 11:37:22 UTC
Following the work on bug 36343, which aimed to improve the consistency of our plugin hook signatures, we introduced a new syntax for the after_biblio_action hooks that includes a payload parameter.

To ensure backward compatibility, the older signature was maintained but marked as deprecated, with warnings logged when it is used.

The purpose of this bug is to complete the deprecation cycle by removing the code that handles the older style syntax and the associated deprecation warnings.

This will involve:

Removing the compatibility code that checks for and handles the old hook signature (without the payload key).

Removing the Koha::Logger warnings that are triggered when the old signature is detected.

Updating any relevant documentation to reflect that only the new signature is supported.

This will help to clean up the codebase, reduce complexity, and ensure that all plugins are using the modern, consistent hook signature.
Comment 1 Martin Renvoize (ashimema) 2025-10-09 12:03:12 UTC
Created attachment 187652 [details] [review]
Bug 40983: Complete deprecation of old after_biblio_action hook signature

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
Comment 2 Marcel de Rooy 2025-10-10 06:52:01 UTC
Created attachment 187715 [details] [review]
Bug 40983: Complete deprecation of old after_biblio_action hook signature

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 <m.de.rooy@rijksmuseum.nl>
Comment 3 Marcel de Rooy 2025-10-10 06:52:03 UTC
Created attachment 187716 [details] [review]
Bug 40983: (QA follow-up) Add a (final) upgrade warn

Just a last wake up call.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 4 Marcel de Rooy 2025-10-10 06:52:48 UTC
Trivial patch. SO and QA in one pass.