Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This patch makes the 'schema' param mandatory. It is passed in every
call on the current codebase, so it makes no harm now, but makes
the code less error-prone.
Tests for this situation are added to t/Koha_MetadataRecord.t (schema
param is omitted and new() returns undef and a carped warning).
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
In order to use Koha::MetadataRecord as a container for moving records
around it is important to let it carry the serialization format
of the record object it was built with, so it is easier and cheaper to
make decisions about records.
This patch introduces regression tests for the changes to be made.
The 'format' param is introduced, and also sets default values:
schema => 'marc21'
format => 'MARC'
A new (optional) 'id' param is added so the record carries its own id outside
of it.
The default behaviour is preserved, and no changes are needed in places
Koha::MetadataRecord is used.
->new also returns undef if no record is passed, and raises a carped warning.
To test:
- Apply this test patch
- Run the new tests
$ prove t/Koha_MetadataRecord.t
=> FAIL: Tests shoud fail as the changes are not implemented on Koha::MetadataRecord
Edit: made serialization format be upper-case to match what is used on Koha::Filter's
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Chris Nighswonger <cnighswonger@foundations.edu>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
http://bugs.koha-community.org/show_bug.cgi?id=9987
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This follow-up moves all the MARC-specific functionality of Koha::Record
(now renamed to Koha::MetadataRecord) to a Koha::Util::MARC utility class.
To test, run relevant unit tests:
> prove t/Koha_MetadataRecord.t t/Koha_Util_MARC.t t/db_dependent/Koha_Authority.t
and optionally try to merge a record.
Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>