To reproduce : 1) Install a plugin which uses the biblionumber of a created record in the "after_biblio_action". 2) Verify the biblionumber is missing This is because the call to the hooks is done before the DB transaction is actually done (in AddBiblio function).
Created attachment 164589 [details] Plugin which demonstrate the issue I made a plugin which demonstrate the issue. After installing the plugin in KTD, you'll have to open /var/log/koha/plack-intranet-error.log. Then, if you create a record, you'll see that when the "after_biblio_action" hook is called, the biblio object is available for some Koha::Biblios namespace thanks to some caching mechanism (first warn in the plugin code is not triggered). However, when the hook is called, it is actually not yet saved to DB. This can be verified by doing a call to an API during the call, and see that this api call do not find the record. This test is implemented in the plugin and you will see in the plack-intranet-error.log that the record is not found.
Created attachment 164607 [details] [review] Bug 36542: after_biblio_action plugin hook is now called after the dbx transaction is finished
if the patch is applied, the log will contains the record data.
We need to log the modified version of the record. We must log after the hook call IMO.
We have a merge commit as the code has moved on a little bit. Can you have a quick look please Arthur.