Bug 14199: Unify marc orgcode plugins, not overwriting existing values
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Sat, 11 Jul 2015 15:22:41 +0000 (17:22 +0200)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 26 Feb 2016 14:04:28 +0000 (14:04 +0000)
commit9fd673f34fb01b79ce65edb6caaa80008dd25539
tree08c31c93686e7dc5c3c946aa1f27cc3067a324bf
parentb73b68f6296fb1ac468f6cb8fbf5024c4a4056af
Bug 14199: Unify marc orgcode plugins, not overwriting existing values

This patch copies code from marc21_field_003.pl to create marc21_orgcode.pl
for more generic use. Other fields like 040c or 040d should use it too.
Note: The plugin is used for authorities too (003, 040a).

One behaviour change is added: If the corresponding field is already
filled, it will not be overwritten.

In the unit test marc21_orgcode already replaces marc21_field_003.

Test plan:
[1] Attach plugin marc21_orgcode to a field (e.g. 003) and test it in
    the MARC editor of Cataloguing or Authorities.
[2] Check if a value is not overwritten any more.
[3] Run unit test t/db_dependent/FrameworkPlugin.t; don't be distracted by
    the noisy warnings of marc21_field_007.pl. They will be addressed on
    another report.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
cataloguing/value_builder/marc21_orgcode.pl [new file with mode: 0755]
t/db_dependent/FrameworkPlugin.t