Bug 34943: Implement `before_biblio_metadata_store` plugin hook
authorTomas Cohen Arazi <tomascohen@theke.io>
Fri, 8 Dec 2023 20:24:35 +0000 (17:24 -0300)
committerKatrin Fischer <katrin.fischer@bsz-bw.de>
Mon, 25 Mar 2024 08:53:20 +0000 (09:53 +0100)
commite78b7bdbe5c10e3d4a568a4560b28e46ab71a02f
tree01f9ab75473093993a82a3f74bf55df198db717b
parentddb2ab7a9fb7e91e10301158fe68d3dfdfae5fcc
Bug 34943: Implement `before_biblio_metadata_store` plugin hook

This patch implements a hook allowing record modification right before
they are written on the DB. The idea is that a plugin could be used to
add machine-generated fields/subfields.

To test:
1. Apply the unit tests patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/Koha/Plugins/Biblio_and_Items_plugin_hooks.t
=> FAIL: Tests fail! The hook is not implemented so the desired results
don't appear (added fields/subfields).
3. Apply this patch
4. Repeat 2
=> SUCCESS: It works!
5. Run:
  k$ qa -c 2
=> SUCCESS: All green!
6. Sign off :-D

Sponsored-by: Theke Solutions
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
C4/Biblio.pm