@@ -, +, @@ serialization format - Run $ prove t/Koha_MetadataRecord.t - Apply this patch - Run $ prove t/Koha_MetadataRecord.t - Run $ prove t/Koha_Util_MARC.t - Sign off :-D --- Koha/MetadataRecord.pm | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) --- a/Koha/MetadataRecord.pm +++ a/Koha/MetadataRecord.pm @@ -32,15 +32,39 @@ and authority) records in Koha. =cut -use strict; -use warnings; -use C4::Context; +use Modern::Perl; + +use Carp; use Koha::Util::MARC; use base qw(Class::Accessor); -__PACKAGE__->mk_accessors(qw( record schema )); +__PACKAGE__->mk_accessors(qw( record schema format )); + + +sub new { + my $class = shift; + my $params = shift; + + if (!defined $params->{ record }) { + carp 'No record passed'; + return; + } + + my $record = $params->{ record }; + my $schema = $params->{ schema } // 'marc21'; + my $format = $params->{ format } // 'usmarc'; + + my $self = $class->SUPER::new({ + record => $record, + schema => $schema, + format => $format + }); + + bless $self, $class; + return $self; +} =head2 createMergeHash --