Bugzilla – Attachment 41316 Details for
Bug 14639
Extend Koha::MetadataRecord to handle serialization format
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14639: Extend Koha::MetadataRecord to handle serialization format
Bug-14639-Extend-KohaMetadataRecord-to-handle-seri.patch (text/plain), 1.64 KB, created by
Tomás Cohen Arazi (tcohen)
on 2015-08-03 14:56:38 UTC
(
hide
)
Description:
Bug 14639: Extend Koha::MetadataRecord to handle serialization format
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2015-08-03 14:56:38 UTC
Size:
1.64 KB
patch
obsolete
>From 10bc9c4d50501e846e4a4e1b2bedb0f68b9fd4e1 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 3 Aug 2015 11:41:23 -0300 >Subject: [PATCH] Bug 14639: Extend Koha::MetadataRecord to handle > serialization format > >The description of this changes is on the regression tests commit >message. > >To test: >- Run > $ prove t/Koha_MetadataRecord.t >=> FAIL: Tests fail because changes are not implemented >- Apply this patch >- Run > $ prove t/Koha_MetadataRecord.t >=> SUCCESS: tests pass >- Run > $ prove t/Koha_Util_MARC.t >=> SUCCESS: it still passes >- Sign off :-D >--- > Koha/MetadataRecord.pm | 32 ++++++++++++++++++++++++++++---- > 1 file changed, 28 insertions(+), 4 deletions(-) > >diff --git a/Koha/MetadataRecord.pm b/Koha/MetadataRecord.pm >index 865dc0d..1a00c9d 100644 >--- a/Koha/MetadataRecord.pm >+++ b/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 > >-- >2.5.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 14639
:
41315
|
41316
|
41357
|
41358
|
41360
|
41361
|
41386
|
41387
|
42312
|
42313
|
42316