]> 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)
committerTomas Cohen Arazi <tomascohen@theke.io>
Fri, 1 Jul 2022 12:15:46 +0000 (09:15 -0300)
commit62bba6d9e12bdf9e3dbf231beae68afe43618f4b
tree1a8d883f99c95a57745b8cddc4822c64249c4a3e
parent41ddbd7b2f6c9b43cfb3b6327d5decc5bfa3a1b4
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>
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]