Bug 11319: Add the field management for Koha::SimpleMARC
authorJonathan Druart <jonathan.druart@biblibre.com>
Wed, 11 Dec 2013 14:39:49 +0000 (15:39 +0100)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Wed, 12 Nov 2014 15:04:16 +0000 (12:04 -0300)
commitc7d862bb7b98e854daa0bfd871f1e8f9f0f2eb39
treebf52528501151a1dabc3611fedf8a12fe40184ad
parent041c24712444953b655f651b812836e5b412568d
Bug 11319: Add the field management for Koha::SimpleMARC

Currently the Koha::SimpleMARC module call a "field" a "subfield".
And the way to manage field is not implemented for all routines.

This patch does not modify the API. The routine's names are kept. It
just creates 2 privates routines for each action (e.g. delete_field
will call _delete_field if the action affects field and _delete_subfield
if the action affects subfields).

Before this patch the move action was authorised by the interface but
caused an error if executed.

Note: I don't see the meaning for the add/update action if no subfield
is given. So the call without subfield raises an error.

Test plan:
- apply all patches
- create or modify an existent template
- try at least the correct behavior for the following actions:
  * delete subfield and field
  * add new subfield to an existing field
  * add new subfield to an nonexisting field
  * move a subfield
  * move an entire field
  * copy a subfield
  * copy an entire field
- import a biblio and use this template
- verify the imported biblio matches actions defined.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Koha/SimpleMARC.pm