[Bug 40972] New: New hook: extend Marc Filter
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40972 Bug ID: 40972 Summary: New hook: extend Marc Filter Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Plugin architecture Assignee: koha-bugs@lists.koha-community.org Reporter: alexander.wagner@desy.de QA Contact: testopia@bugs.koha-community.org 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. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40972 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40972 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #1 from David Cook <dcook@prosentient.com.au> --- Off the top of my head, I might be a bit worried about this from a performance perspective, but it's interesting. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40972 --- Comment #2 from Alexander Wagner <alexander.wagner@desy.de> --- 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.) -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40972 --- Comment #3 from David Cook <dcook@prosentient.com.au> --- (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. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40972 Mark Hofstetter <koha@trust-box.at> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |koha@trust-box.at --- Comment #4 from Mark Hofstetter <koha@trust-box.at> --- several customers/user have expressed interest in this issue, so I'm looking into it I don't see the performance issues as grave, but have to kept in mind -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40972 Mark Hofstetter <koha@trust-box.at> changed: What |Removed |Added ---------------------------------------------------------------------------- Sponsorship status|--- |Sponsored Status|NEW |In Discussion Patch complexity|--- |Small patch Comma delimited| |Naturhistorisches Museum list of Sponsors| |Wien -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40972 --- Comment #5 from Mark Hofstetter <koha@trust-box.at> --- Created attachment 192611 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192611&action=edit 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). -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40972 --- Comment #6 from Alexander Wagner <alexander.wagner@desy.de> --- AFAIS from my first tests this does the trick and allows the test-plugin to act accordingly. I could start migrating the filter code that exists already for the plugin. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40972 --- Comment #7 from Alexander Wagner <alexander.wagner@desy.de> --- WRT the performance issues mentioned, I wonder if it was ever discussed to cache (some of) the calculated output formats. Calculating e.g. the brief display for the search results list upon record change would probably have the most impact, while calculating the details page on the fly should always be fast enough these days. (At least this is the experience we have on our current, non-koha system. Said system has indeed some quite clever handling on this end, but implementing it in full glory would be a major change to Kohas processing.) -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40972 Alexander Wagner <alexander.wagner@desy.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #192611|0 |1 is obsolete| | --- Comment #8 from Alexander Wagner <alexander.wagner@desy.de> --- Created attachment 192901 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192901&action=edit 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> -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40972 Alexander Wagner <alexander.wagner@desy.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|In Discussion |Needs Signoff -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40972 --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Hi Alexander, did you mean to set this to Signed off? -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40972 --- Comment #10 from Alexander Wagner <alexander.wagner@desy.de> --- I was unsure if a bug propagates from "on discussion" by one sign off right to `singed off` or if it requires a second sign off. But in principle it works in my test according to Marks plan as designed. I even changed the code I use for j2k to integrate with Marks plugin. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40972 Alexander Wagner <alexander.wagner@desy.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40972 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lisette@bywatersolutions.co | |m -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40972 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |nick@bywatersolutions.com |y.org | Assignee|koha-bugs@lists.koha-commun |mark@hofstetter.at |ity.org | CC| |nick@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40972 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40972 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #192901|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40972 --- Comment #11 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 196210 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196210&action=edit 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> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40972 --- Comment #12 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 196211 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196211&action=edit Bug 40972: (QA follow-up) POD Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40972 --- Comment #13 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Ideally we would have a unit test here too, but it's a small enough change, passing QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40972 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|New hook: extend Marc |New hook: extend MARC |Filter |filter -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40972 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |release-notes-needed CC| |lucas@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40972 --- Comment #14 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- This needs release notes and should be added here: https://wiki.koha-community.org/wiki/Koha_Plugin_Hooks -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40972 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |26.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40972 --- Comment #15 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Nice work everyone! Pushed to main for 26.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40972 Jacob O'Mara <jacob.omara@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|26.05.00 |26.05.00,25.11.05 released in| | Status|Pushed to main |Pushed to stable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40972 --- Comment #16 from Jacob O'Mara <jacob.omara@openfifth.co.uk> --- Thanks all, pushed to 25.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40972 Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Needs documenting CC| |wainuiwitikapark@catalyst.n | |et.nz --- Comment #17 from Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> --- Enhancement - not backporting to 25.05 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org