Bugzilla – Attachment 192901 Details for
Bug 40972
New hook: extend Marc Filter
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40972: Add XSLT record processor filter hook for plugins
Bug-40972-Add-XSLT-record-processor-filter-hook-fo.patch (text/plain), 2.13 KB, created by
Alexander Wagner
on 2026-02-10 14:06:52 UTC
(
hide
)
Description:
Bug 40972: Add XSLT record processor filter hook for plugins
Filename:
MIME Type:
Creator:
Alexander Wagner
Created:
2026-02-10 14:06:52 UTC
Size:
2.13 KB
patch
obsolete
>From f50396b363579b3d543913c33cc6bf94e10e611a Mon Sep 17 00:00:00 2001 >From: Mark Hofstetter <mark@hofstetter.at> >Date: Fri, 6 Feb 2026 12:21:29 +0100 >Subject: [PATCH] Bug 40972: Add XSLT record processor filter hook for plugins > >Koha's XSLT display path now calls a plugin hook so plugins can >extend the record processor filter list before MARC is transformed. >This enables prototype punctuation filters (and similar) to run >as plugins without core changes. > >Test plan: >1) Enable plugins in koha-conf.xml. >2) Install the TestPunctuation plugin from https://github.com/HKS3/koha-test-punctuation >3) Enable the plugin in Koha admin. >4) View a biblio in staff or OPAC with XSLT display enabled and confirm > the filter runs (e.g., 245$a gets a trailing period if missing). > >Signed-off-by: Alexander Wagner <alexander.wagner@desy.de> >--- > C4/XSLT.pm | 18 ++++++++++++++++-- > 1 file changed, 16 insertions(+), 2 deletions(-) > >diff --git a/C4/XSLT.pm b/C4/XSLT.pm >index be3ac7d41f..ddf0cbfe0d 100644 >--- a/C4/XSLT.pm >+++ b/C4/XSLT.pm >@@ -39,6 +39,7 @@ use C4::Koha qw( xml_escape ); > use C4::Biblio qw( GetAuthorisedValueDesc GetFrameworkCode GetMarcStructure ); > use Koha::AuthorisedValues; > use Koha::ItemTypes; >+use Koha::Plugins; > use Koha::RecordProcessor; > use Koha::Libraries; > use Koha::Recalls; >@@ -197,10 +198,23 @@ sub XSLTParse4Display { > > my $xslfilename = get_xsl_filename($xslsyspref); > >- my $frameworkcode = GetFrameworkCode($biblionumber) || ''; >+ my $frameworkcode = GetFrameworkCode($biblionumber) || ''; >+ my $filters = ['ExpandCodedFields']; >+ >+ Koha::Plugins->call( >+ 'xslt_record_processor_filters', >+ { >+ filters => $filters, >+ interface => $interface, >+ frameworkcode => $frameworkcode, >+ xsl_syspref => $xslsyspref, >+ biblionumber => $biblionumber, >+ } >+ ); >+ > my $record_processor = Koha::RecordProcessor->new( > { >- filters => ['ExpandCodedFields'], >+ filters => $filters, > options => { > interface => $interface, > frameworkcode => $frameworkcode >-- >2.39.5
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 40972
:
192611
| 192901