Bugzilla – Attachment 31700 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]
Bug 12957: Get rid of warnings in aqbudgets.pl
Bug-12957-Get-rid-of-warnings-in-aqbudgetspl.patch (text/plain), 3.81 KB, created by
Jonathan Druart
on 2014-09-18 10:59:06 UTC
(
hide
)
Description:
Bug 12957: Get rid of warnings in aqbudgets.pl
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2014-09-18 10:59:06 UTC
Size:
3.81 KB
patch
obsolete
>From 1b92b0fbdfbd3f04f154b32f93975625e4f8825e 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] 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. >--- > admin/aqbudgets.pl | 16 +++++----------- > 1 file changed, 5 insertions(+), 11 deletions(-) > >diff --git a/admin/aqbudgets.pl b/admin/aqbudgets.pl >index 4b8d1a3..3d7076f 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; > } >@@ -330,10 +329,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"} }; >@@ -346,7 +341,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; > } > >-- >2.1.0
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