From c4f041a9d60433a7156b1d962ac6c3f90265b551 Mon Sep 17 00:00:00 2001 From: Mason James Date: Wed, 27 Jun 2012 02:50:50 +1200 Subject: [PATCH] Bug 6679 - [SIGNED-OFF] fix 3 perlcritic violations in C4/Items.pm "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) Signed-off-by: Jonathan Druart Signed-off-by: Paul Poulain --- C4/Items.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/C4/Items.pm b/C4/Items.pm index e9af3dd67d..c114e6363f 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -530,7 +530,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}; @@ -2293,7 +2293,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 @@ -2668,7 +2668,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; } -- 2.39.5