[Koha-patches] [PATCH] Bug 6679 Enable Newly added files to pass testcritic
Colin Campbell
colin.campbell at ptfs-europe.com
Fri Sep 14 15:07:20 CEST 2012
Ywo cases of return null in recently added modules
are causing testcritic to fail. Replace return undefs
with return
---
Koha/Authority.pm | 4 +++-
Koha/Filter/MARC/EmbedSeeFromHeadings.pm | 4 +++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/Koha/Authority.pm b/Koha/Authority.pm
index b64f8de..329b438 100644
--- a/Koha/Authority.pm
+++ b/Koha/Authority.pm
@@ -77,7 +77,9 @@ sub get_from_authid {
my ($authtypecode, $marcxml) = $sth->fetchrow;
my $record=eval {MARC::Record->new_from_xml(StripNonXmlChars($marcxml),'UTF-8',
(C4::Context->preference("marcflavour") eq "UNIMARC"?"UNIMARCAUTH":C4::Context->preference("marcflavour")))};
- return undef if ($@);
+ if ($@) {
+ return;
+ }
$record->encoding('UTF-8');
my $self = $class->SUPER::new( { authid => $authid,
diff --git a/Koha/Filter/MARC/EmbedSeeFromHeadings.pm b/Koha/Filter/MARC/EmbedSeeFromHeadings.pm
index ea7e38b..bf6295f 100644
--- a/Koha/Filter/MARC/EmbedSeeFromHeadings.pm
+++ b/Koha/Filter/MARC/EmbedSeeFromHeadings.pm
@@ -54,7 +54,9 @@ sub filter {
my $record = shift;
my $newrecord;
- return undef unless defined $record;
+ if ( !defined $record ) {
+ return;
+ }
if (ref $record eq 'ARRAY') {
my @recarray;
--
1.7.12.363.g53284de
More information about the Koha-patches
mailing list