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)
committerArthur Suzuki <arthur.suzuki@biblibre.com>
Thu, 11 Aug 2022 13:40:33 +0000 (15:40 +0200)
commit52dd29792ef8c746827e6071cd85e46a5dcbc8c1
treebde7188f0af4774755f3262d582b07d9e421e161
parent3188d9eed02eee6f58bd8174b35d6323daae7883
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>
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]