From 06ca6df6f7a79aadca46edac4eb7f754c75938c4 Mon Sep 17 00:00:00 2001 From: Mason James Date: Wed, 27 Jun 2012 02:50:50 +1200 Subject: [PATCH] Bug 6679 - fix 3 perlcritic violations in C4/Items.pm Content-Type: text/plain; charset="utf-8" http://koha-community.org "return" statement with explicit "undef" at line 508, column 44. See page 199 of PBP. (Severity: 5) "return" statement with explicit "undef" at line 2267, column 5. See page 199 of PBP. (Severity: 5) Variable declared in conditional statement at line 2642, column 21. Declare variables outside of the condition. (Severity: 5) --- C4/Items.pm | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/C4/Items.pm b/C4/Items.pm index 2afe537..18e4e6d 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -505,7 +505,7 @@ sub ModItem { $item->{'more_subfields_xml'} = _get_unlinked_subfields_xml($unlinked_item_subfields); }; - $item->{'itemnumber'} = $itemnumber or return undef; + $item->{'itemnumber'} = $itemnumber or return; $item->{onloan} = undef if $item->{itemlost}; @@ -2264,7 +2264,7 @@ sub _koha_delete_item { # delete from items table $sth = $dbh->prepare("DELETE FROM items WHERE itemnumber=?"); $sth->execute($itemnum); - return undef; + return; } =head2 _marc_from_item_hash @@ -2639,7 +2639,10 @@ sub PrepareItemrecordDisplay { if ( ( $tagslib->{$tag}->{$subfield}->{kohafield} eq 'items.location' ) && $defaultvalues && $defaultvalues->{'location'} ) { - my $temp = $itemrecord->field($subfield) if ($itemrecord); + + my $temp; # make perlcritic happy :) + $temp = $itemrecord->field($subfield) if ($itemrecord); + unless ($temp) { $defaultvalue = $defaultvalues->{location} if $defaultvalues; } -- 1.7.2.5