From 7c315447d6c74adcfa2f11f49470ce369b3ebe03 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 3 Dec 2013 15:09:01 +0100 Subject: [PATCH] Bug 7673: QA Followup: trailing whitespace and perlcritic issues This patch fixes the following qa issues: FAIL cataloguing/additem.pl FAIL forbidden patterns forbidden pattern: trailing space char (line 833) FAIL critic # Variables::ProhibitConditionalDeclarations: Got 2 violation(s). FAIL tools/batchMod.pl FAIL critic # Variables::ProhibitConditionalDeclarations: Got 2 violation(s). --- cataloguing/additem.pl | 8 ++++---- tools/batchMod.pl | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl index e89e96e..9b59a85 100755 --- a/cataloguing/additem.pl +++ b/cataloguing/additem.pl @@ -370,8 +370,8 @@ my ($template, $loggedinuser, $cookie) # Does the user have a limited item edition permission? -my $uid = GetMember( borrowernumber => $loggedinuser )->{userid} if ($loggedinuser) ; -my $limitededition = haspermission($uid, {'editcatalogue' => 'limited_item_edition'}) if ($uid); +my $uid = $loggedinuser ? GetMember( borrowernumber => $loggedinuser )->{userid} : undef; +my $limitededition = $uid ? haspermission($uid, {'editcatalogue' => 'limited_item_edition'}) : undef; # In case user is a superlibrarian, edition is not limited $limitededition = 0 if ($limitededition != 0 && $limitededition->{'superlibrarian'} eq 1); @@ -831,10 +831,10 @@ foreach my $tag ( keys %{$tagslib}){ my @values = (undef); @values = $itemrecord->field($tag)->subfield($subtag) if ($itemrecord && defined($itemrecord->field($tag)) && defined($itemrecord->field($tag)->subfield($subtag))); for my $value (@values){ - my $subfield_data = generate_subfield_form($tag, $subtag, $value, $tagslib, $tagslib->{$tag}->{$subtag}, $branches, $today_iso, $biblionumber, $temp, \@loop_data, $i, $limitededition); + my $subfield_data = generate_subfield_form($tag, $subtag, $value, $tagslib, $tagslib->{$tag}->{$subtag}, $branches, $today_iso, $biblionumber, $temp, \@loop_data, $i, $limitededition); push (@loop_data, $subfield_data); $i++; - } + } } } @loop_data = sort {$a->{subfield} cmp $b->{subfield} } @loop_data; diff --git a/tools/batchMod.pl b/tools/batchMod.pl index ef63a5b..cccc97e5 100755 --- a/tools/batchMod.pl +++ b/tools/batchMod.pl @@ -71,8 +71,8 @@ my ($template, $loggedinuser, $cookie) }); # Does the user have a limited item edition permission? -my $uid = GetMember( borrowernumber => $loggedinuser )->{userid} if ($loggedinuser) ; -my $limitededition = haspermission($uid, {'tools' => 'items_limited_batchmod'}) if ($uid); +my $uid = $loggedinuser ? GetMember( borrowernumber => $loggedinuser )->{userid} : undef; +my $limitededition = $uid ? haspermission($uid, {'tools' => 'items_limited_batchmod'}) : undef; # In case user is a superlibrarian, edition is not limited $limitededition = 0 if ($limitededition != 0 && $limitededition->{'superlibrarian'} eq 1); -- 1.7.10.4