Bugzilla – Attachment 32278 Details for
Bug 12957
Get rid of warning in aqbudgets.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 12957: Get rid of warnings in aqbudgets.pl
PASSED-QA-Bug-12957-Get-rid-of-warnings-in-aqbudge.patch (text/plain), 4.00 KB, created by
Katrin Fischer
on 2014-10-11 21:36:58 UTC
(
hide
)
Description:
[PASSED QA] Bug 12957: Get rid of warnings in aqbudgets.pl
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2014-10-11 21:36:58 UTC
Size:
4.00 KB
patch
obsolete
>From 1d97afcc5459dd97b315c69d48a6883f7067e050 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Thu, 18 Sep 2014 12:56:50 +0200 >Subject: [PATCH] [PASSED QA] Bug 12957: Get rid of warnings in aqbudgets.pl > >There are a lot of warnings on navigating into the fund views (list, >editing, etc.) > >"Use of uninitialized value in string eq..." >"Use of uninitialized value in hash element" >"Use of uninitialized value in concatenation..." > >Test plan: >Verify the warnings don't appear anymore in logs on going on the fund >list view, editing a fund, saving a fund. > >QA note: the budget_owner_name, budget_borrowernumber and branchname are >never used on the fund list view. A call to GetMember has been removed. > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> >This seems to work nicely reducing the amount of noise in the log >considerably. >--- > admin/aqbudgets.pl | 16 +++++----------- > 1 file changed, 5 insertions(+), 11 deletions(-) > >diff --git a/admin/aqbudgets.pl b/admin/aqbudgets.pl >index 1a66c9c..accdb78 100755 >--- a/admin/aqbudgets.pl >+++ b/admin/aqbudgets.pl >@@ -100,8 +100,7 @@ $template->param( > op => $op, > ); > >-# retrieve branches >-my ( $budget, ); >+my $budget; > > my $branches = GetBranches($show_mine); > my @branchloop2; >@@ -132,7 +131,7 @@ if ($op eq 'add_form') { > } > $dropbox_disabled = BudgetHasChildren($budget_id); > my $borrower = &GetMember( borrowernumber=>$budget->{budget_owner_id} ); >- $budget->{budget_owner_name} = $borrower->{'firstname'} . ' ' . $borrower->{'surname'}; >+ $budget->{budget_owner_name} = ( $borrower ? $borrower->{'firstname'} . ' ' . $borrower->{'surname'} : '' ); > $$budget{$_}= sprintf("%.2f", $budget->{$_}) for grep{ /amount|encumb|expend/ } keys %$budget; > } > >@@ -164,7 +163,7 @@ if ($op eq 'add_form') { > value => $thisbranch, > branchname => $branches->{$thisbranch}->{'branchname'}, > ); >- $row{selected} = 1 if $thisbranch eq $budget->{'budget_branchcode'}; >+ $row{selected} = 1 if $budget and $thisbranch eq $budget->{'budget_branchcode'}; > push @branchloop_select, \%row; > } > >@@ -173,14 +172,14 @@ if ($op eq 'add_form') { > my @auth_cats_loop1 = (); > foreach my $category (@$categories) { > my $entry = { category => $category, >- selected => $budget->{sort1_authcat} eq $category ?1:0, >+ selected => ( $budget and $budget->{sort1_authcat} eq $category ? 1 : 0 ), > }; > push @auth_cats_loop1, $entry; > } > my @auth_cats_loop2 = (); > foreach my $category (@$categories) { > my $entry = { category => $category, >- selected => $budget->{sort2_authcat} eq $category ?1:0, >+ selected => ( $budget and $budget->{sort2_authcat} eq $category ? 1 : 0 ), > }; > push @auth_cats_loop2, $entry; > } >@@ -321,10 +320,6 @@ if ( $op eq 'list' ) { > $budget->{"budget_spent"} = $num->format_price(0) unless defined($budget->{"budget_spent"}); > $budget->{budget_ordered} = $num->format_price(0) unless defined($budget->{"budget_ordered"}); > >- my $borrower = &GetMember( borrowernumber=>$budget->{budget_owner_id} ); >- $budget->{"budget_owner_name"} = $borrower->{'firstname'} . ' ' . $borrower->{'surname'}; >- $budget->{"budget_borrowernumber"} = $borrower->{'borrowernumber'}; >- > #Make a list of parents of the bugdet > my @budget_hierarchy; > push @budget_hierarchy, { element_name => $budget->{"budget_name"}, element_id => $budget->{"budget_id"} }; >@@ -337,7 +332,6 @@ if ( $op eq 'list' ) { > push @budget_hierarchy, { element_name => $period->{"budget_period_description"} }; > @budget_hierarchy = reverse(@budget_hierarchy); > >- $budget->{branchname} = $branches->{ $budget->{branchcode} }->{branchname}; > $budget->{budget_hierarchy} = \@budget_hierarchy; > } > >-- >1.9.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 12957
:
31700
|
32151
| 32278