Bugzilla – Attachment 161696 Details for
Bug 34943
Add a pre-save plugin hook for biblios
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34943: Implement `before_biblio_metadata_store` plugin hook
Bug-34943-Implement-beforebibliometadatastore-plug.patch (text/plain), 1.40 KB, created by
Martin Renvoize (ashimema)
on 2024-01-31 16:09:57 UTC
(
hide
)
Description:
Bug 34943: Implement `before_biblio_metadata_store` plugin hook
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-01-31 16:09:57 UTC
Size:
1.40 KB
patch
obsolete
>From 3cd00c1c42d5ecfc2943197a4ecd159d3d0325bb Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Fri, 8 Dec 2023 17:24:35 -0300 >Subject: [PATCH] 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> >--- > C4/Biblio.pm | 2 ++ > 1 file changed, 2 insertions(+) > >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index ab895b25753..1e33c63ef4a 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -2867,6 +2867,8 @@ sub ModBiblioMarc { > Koha::Util::MARC::set_marc_field($record, C4::Context->preference('MarcFieldForModifierName'), $borrowername); > } > >+ Koha::Plugins->call( 'before_biblio_metadata_store', $record ); >+ > $m_rs->metadata( $record->as_xml_record($encoding) ); > $m_rs->store; > >-- >2.43.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 34943
:
159680
|
159681
|
159682
|
159683
|
159684
|
159685
|
159686
|
159687
|
159690
|
159691
|
161695
|
161696
|
163048
|
163325
|
163326
|
163327
|
163711
|
163712
|
163713