Bug 40972 - New hook: extend Marc Filter
Summary: New hook: extend Marc Filter
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Plugin architecture (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-10-08 11:37 UTC by Alexander Wagner
Modified: 2025-10-13 23:54 UTC (History)
2 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Wagner 2025-10-08 11:37:57 UTC
Koha allows to add filters that massage the Marc record before it is passed on to the processing routines. The relevant section in C4::XLST.pm reads

```perl

    my $record_processor = Koha::RecordProcessor->new(
        {
            filters => ['ExpandCodedFields'],
            options => {
                interface     => $interface,
                frameworkcode => $frameworkcode
            }
        }
    );

```

Unfortunately, there seems easily accessible way to extend the `filters` array so it is currently not possible to eg. hook up a plugin to add a filter in this position.

To help proceeding on bugs 21303, 30018, 37296, 37325 it would be helpful to have a hook here so development of the automatic punctuation could first be done as a plugin.
Comment 1 David Cook 2025-10-08 23:41:48 UTC
Off the top of my head, I might be a bit worried about this from a performance perspective, but it's interesting.
Comment 2 Alexander Wagner 2025-10-13 07:21:47 UTC
So your fear is that the perl processing step is way slower then the XSLT or do you fear that adding the chars on the fly is a general issue?

(BTW: the processing would be cut short for fields that hold punctuation.)
Comment 3 David Cook 2025-10-13 23:54:45 UTC
(In reply to Alexander Wagner from comment #2)
> So your fear is that the perl processing step is way slower then the XSLT or
> do you fear that adding the chars on the fly is a general issue?

Just any time we add more code for something in a loop, it's going to slow down, so just thinking about scalability.