]> git.koha-community.org Git - koha.git/commit
Bug 30848: Add an ExpandCodedFields RecordProcessor filter
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Thu, 26 May 2022 09:24:50 +0000 (10:24 +0100)
committerVictor Grousset/tuxayo <victor@tuxayo.net>
Mon, 15 Aug 2022 20:31:46 +0000 (22:31 +0200)
commit26e2f2c11a87261bbb08c9162b5c704a78a7f067
treecd1f4532263036fcf68a6f95d3bbf4e5fafdcb68
parent1d4dbdab06f7f76e3d2a90663589357e21e6a2aa
Bug 30848: Add an ExpandCodedFields RecordProcessor filter

This patch introduces a RecordProcessor filter for MARC::Record objects
that replaces Koha codes with descriptions in the MARC::Record passed to the processor.

Target usage:

  my $biblio = Koha::Biblios->find(
      $biblio_id,
      { prefetch => [ metadata ] }
  );

  my $record = $biblio->metadata->record;

  my $processor = Koha::RecordProcessor->new(
    {
        filters => ('ExpandCodedFields'),
        options => {
            interface     => 'opac',
            frameworkcode => $biblio->frameworkcode
        }
    }
  );

  $processor->process( $record );

Test plan
* Read the included unit test and confirm it makes sense and passes

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 62bba6d9e12bdf9e3dbf231beae68afe43618f4b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0a861042947adbc12b4d865c89c6a87effe965b9)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit 52dd29792ef8c746827e6071cd85e46a5dcbc8c1)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Koha/Filter/MARC/ExpandCodedFields.pm [new file with mode: 0644]
admin/biblio_framework.pl
admin/marc_subfields_structure.pl
admin/marctagstructure.pl
t/db_dependent/Koha/Filter/ExpandCodedFields.t [new file with mode: 0644]