Bug 34786

Summary: after_biblio_action hooks: find after delete makes no sense
Product: Koha Reporter: Marcel de Rooy <m.de.rooy>
Component: Architecture, internals, and plumbingAssignee: Marcel de Rooy <m.de.rooy>
Status: Pushed to oldstable --- QA Contact: Martin Renvoize <martin.renvoize>
Severity: minor    
Priority: P5 - low CC: fridolin.somers, martin.renvoize
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.11.00,23.05.04,22.11.11
Bug Depends on: 22709    
Bug Blocks: 35965    
Attachments: Bug 34786: after_biblio_action hooks - No find when action is delete
Bug 34786: after_biblio_action hooks - No find when action is delete

Description Marcel de Rooy 2023-09-14 09:02:57 UTC
$error = _koha_delete_biblio( $dbh, $biblionumber );
    _after_biblio_action_hooks({ action => 'delete', biblio_id => $biblionumber });

AND 

    my $biblio_id = $args->{biblio_id};
    my $action    = $args->{action};
    my $biblio = Koha::Biblios->find( $biblio_id );

Makes no sense.
Comment 1 Marcel de Rooy 2023-09-14 09:14:38 UTC
Created attachment 155605 [details] [review]
Bug 34786: after_biblio_action hooks - No find when action is delete

Test plan:
Run t/db_dependent/Koha/Plugins/Biblio_and_Items_plugin_hooks.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 2 Marcel de Rooy 2023-09-14 09:14:57 UTC
Super trivial: self SO
Comment 3 Martin Renvoize 2023-09-18 11:04:53 UTC
Created attachment 155799 [details] [review]
Bug 34786: after_biblio_action hooks - No find when action is delete

Test plan:
Run t/db_dependent/Koha/Plugins/Biblio_and_Items_plugin_hooks.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 4 Martin Renvoize 2023-09-18 11:05:15 UTC
Trivial improvement.. Passing QA
Comment 5 Tomás Cohen Arazi 2023-09-18 18:55:13 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 6 Fridolin Somers 2023-09-18 21:34:02 UTC
Pushed to 23.05.x for 23.05.04
Comment 7 Matt Blenkinsop 2023-10-12 16:01:16 UTC
Nice work everyone!

Pushed to oldstable for 22.11.x