Bug 40983

Summary: Remove deprecated syntax for 'after_biblio_action' hooks
Product: Koha Reporter: Martin Renvoize (ashimema) <martin.renvoize>
Component: Plugin architectureAssignee: Martin Renvoize (ashimema) <martin.renvoize>
Status: Passed QA --- QA Contact: Marcel de Rooy <m.de.rooy>
Severity: minor    
Priority: P5 - low CC: m.de.rooy, tomascohen
Version: Main   
Hardware: All   
OS: All   
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:
Bug Depends on: 36343    
Bug Blocks:    
Attachments: Bug 40983: Complete deprecation of old after_biblio_action hook signature
Bug 40983: Complete deprecation of old after_biblio_action hook signature
Bug 40983: (QA follow-up) Add a (final) upgrade warn

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.