From cb39d7141a2bdab5b390f1581be6f6d59c7c07d3 Mon Sep 17 00:00:00 2001 From: Mason James Date: Wed, 27 Jun 2012 01:58:38 +1200 Subject: [PATCH 1/1] Bug 6679 - [SIGNED-OFF] fix 5 perlcritic violations in C4/VirtualShelves.pm, and comment-out obselete sub() - Subroutine prototypes used at line 224, column 1. See page 194 of PBP. (Severity: 5) - "return" statement with explicit "undef" at line 354, column 22. See page 199 of PBP. (Severity: 5) - Don't modify $_ in list functions at line 664, column 5. See page 114 of PBP. (Severity: 5) Signed-off-by: Jonathan Druart --- C4/VirtualShelves.pm | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/C4/VirtualShelves.pm b/C4/VirtualShelves.pm index 20f3620..d1db174 100644 --- a/C4/VirtualShelves.pm +++ b/C4/VirtualShelves.pm @@ -221,7 +221,7 @@ Returns the above-mentioned fields for passed virtual shelf number. =cut -sub GetShelf ($) { +sub GetShelf { my ($shelfnumber) = @_; my $query = qq( SELECT shelfnumber, shelfname, owner, category, sortfield, @@ -252,7 +252,7 @@ from C4::Circulation. =cut -sub GetShelfContents ($;$$$) { +sub GetShelfContents { my ($shelfnumber, $row_count, $offset, $sortfield) = @_; my $dbh=C4::Context->dbh(); my $sth1 = $dbh->prepare("SELECT count(*) FROM virtualshelfcontents WHERE shelfnumber = ?"); @@ -351,7 +351,7 @@ sub AddToShelf { my $sth = $dbh->prepare($query); $sth->execute( $shelfnumber, $biblionumber ); - ($sth->rows) and return undef; # already on shelf + ($sth->rows) and return; # already on shelf $query = qq( INSERT INTO virtualshelfcontents (shelfnumber, biblionumber, flags, borrowernumber) @@ -658,7 +658,8 @@ sub _biblionumber_sth { #only used in obsolete sub below $sth; } -sub each_biblionumbers (&$) { #OBSOLETE +=c +sub each_biblionumbers { #OBSOLETE my ($code,$shelf) = @_; my $ref = _biblionumber_sth($shelf)->fetchall_arrayref; map { @@ -666,6 +667,7 @@ sub each_biblionumbers (&$) { #OBSOLETE $code->(); } @$ref; } +=cut sub _CheckShelfName { my ($name, $cat, $owner, $number)= @_; -- 1.7.7.3