From 8931489565e6c272bce18dd3971e932cb78b0074 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 14 Jan 2016 12:27:55 +0000 Subject: [PATCH] Bug 15578: Make sure all params will be taken into account when instantiating The tests in t/db_dependent/Koha_Authority.t expects at least 1 authority record in the DB to run them, otherwise they are skipped. On our integration server, the DB does not contain any records, and the tests are skipped. Unfortunately these tests were testing the authid method of Koha::MetadataRecord::Authority. Test plan: Apply the first patch, launch tests => Fail Apply the second patch, launch tests => \o/ Signed-off-by: Jonathan Druart Signed-off-by: Julian Maurice --- Koha/MetadataRecord.pm | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/Koha/MetadataRecord.pm b/Koha/MetadataRecord.pm index 1577cd04d5..1b2f4aa2f6 100644 --- a/Koha/MetadataRecord.pm +++ b/Koha/MetadataRecord.pm @@ -87,17 +87,8 @@ sub new { return; } - my $record = $params->{ record }; - my $schema = $params->{ schema }; - my $format = $params->{ format } // 'MARC'; - my $id = $params->{ id }; - - my $self = $class->SUPER::new({ - record => $record, - schema => $schema, - format => $format, - id => $id - }); + $params->{format} //= 'MARC'; + my $self = $class->SUPER::new($params); bless $self, $class; return $self; -- 2.39.5