Bug 39156

Summary: Add plugin hooks for batch operations on authority, biblio and items
Product: Koha Reporter: Shi Yao Wang <shi-yao.wang>
Component: Plugin architectureAssignee: Shi Yao Wang <shi-yao.wang>
Status: Signed Off --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: caroline.cyr-la-rose, matthias.meusburger
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 39156: Add hooks before and after batch on authority/biblio/item
Bug 39156: Add missing hooks in MARCImportRevertBatch
Bug 39156: Add hooks before and after batch on authority/biblio/item
Bug 39156: Add missing hooks in MARCImportRevertBatch
Bug 39156: Unit test
Bug 39156: Add hooks before and after batch on authority/biblio/item
Bug 39156: Add missing hooks in MARCImportRevertBatch
Bug 39156: Unit test
Bug 39156: Pass batch action to the hooks + refactoring
Bug 39156: Add hooks before and after batch on authority/biblio/item
Bug 39156: Add missing hooks in MARCImportRevertBatch
Bug 39156: Unit test
Bug 39156: Pass batch action to the hooks + refactoring

Description Shi Yao Wang 2025-02-18 14:26:39 UTC

    
Comment 1 Shi Yao Wang 2025-02-18 14:32:54 UTC
Created attachment 178274 [details] [review]
Bug 39156: Add hooks before and after batch on authority/biblio/item

Useful to dump marc files after batch operation for example
Comment 2 Shi Yao Wang 2025-02-27 16:27:15 UTC
Created attachment 178790 [details] [review]
Bug 39156: Add missing hooks in MARCImportRevertBatch
Comment 3 Shi Yao Wang 2025-03-31 19:07:35 UTC
Created attachment 180079 [details] [review]
Bug 39156: Add hooks before and after batch on authority/biblio/item

Useful to dump marc files after batch operation for example
Comment 4 Shi Yao Wang 2025-03-31 19:07:38 UTC
Created attachment 180080 [details] [review]
Bug 39156: Add missing hooks in MARCImportRevertBatch
Comment 5 Shi Yao Wang 2025-03-31 19:07:40 UTC
Created attachment 180081 [details] [review]
Bug 39156: Unit test

Test plan:
1- Apply the patch
2- run
`prove t/db_dependent/Koha/Plugins/Biblio_and_items_plugin_hooks.t`
3- Tests should pass
Comment 6 Shi Yao Wang 2025-04-01 16:13:44 UTC
Created attachment 180219 [details] [review]
Bug 39156: Add hooks before and after batch on authority/biblio/item

Useful to dump marc files after batch operation for example
Comment 7 Shi Yao Wang 2025-04-01 16:13:47 UTC
Created attachment 180220 [details] [review]
Bug 39156: Add missing hooks in MARCImportRevertBatch
Comment 8 Shi Yao Wang 2025-04-01 16:13:49 UTC
Created attachment 180221 [details] [review]
Bug 39156: Unit test

Test plan:
1- Apply the patch
2- run
`prove t/db_dependent/Koha/Plugins/Batch_plugin_hooks.t`
3- Tests should pass
Comment 9 Matthias Meusburger 2025-04-02 08:27:52 UTC
Hi,

Could you perhaps add an action parameter to the call (so the plugin knows which kind of action was performed or is going to be performed) ?

Something similar to what what done for:

 - Bug 27173 - Add plugin hooks for authority record changes 
 or
 - Bug 27066 - Implement hooks for patrons updates
Comment 10 Shi Yao Wang 2025-04-02 16:29:33 UTC
Created attachment 180422 [details] [review]
Bug 39156: Pass batch action to the hooks + refactoring
Comment 11 Shi Yao Wang 2025-04-02 16:31:09 UTC
(In reply to Matthias Meusburger from comment #9)
> Hi,
> 
> Could you perhaps add an action parameter to the call (so the plugin knows
> which kind of action was performed or is going to be performed) ?
> 
> Something similar to what what done for:
> 
>  - Bug 27173 - Add plugin hooks for authority record changes 
>  or
>  - Bug 27066 - Implement hooks for patrons updates

I added an action parameter. I hope they are descriptive enough :)
Comment 12 Matthias Meusburger 2025-04-03 07:20:42 UTC
Ok, thanks, works for me, I'm signing this off.
Comment 13 Matthias Meusburger 2025-04-03 07:22:32 UTC
Created attachment 180428 [details] [review]
Bug 39156: Add hooks before and after batch on authority/biblio/item

Useful to dump marc files after batch operation for example

Signed-off-by: Matthias Meusburger <matthias.meusburger@biblibre.com>
Comment 14 Matthias Meusburger 2025-04-03 07:22:35 UTC
Created attachment 180429 [details] [review]
Bug 39156: Add missing hooks in MARCImportRevertBatch

Signed-off-by: Matthias Meusburger <matthias.meusburger@biblibre.com>
Comment 15 Matthias Meusburger 2025-04-03 07:22:39 UTC
Created attachment 180430 [details] [review]
Bug 39156: Unit test

Test plan:
1- Apply the patch
2- run
`prove t/db_dependent/Koha/Plugins/Batch_plugin_hooks.t`
3- Tests should pass

Signed-off-by: Matthias Meusburger <matthias.meusburger@biblibre.com>
Comment 16 Matthias Meusburger 2025-04-03 07:22:42 UTC
Created attachment 180431 [details] [review]
Bug 39156: Pass batch action to the hooks + refactoring

Signed-off-by: Matthias Meusburger <matthias.meusburger@biblibre.com>