From d94c26aae3c670af0ee8ba50f9424ca4804a7fd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9rick=20Capovilla?= Date: Wed, 30 Mar 2011 12:12:19 -0400 Subject: [PATCH][SIGNED-OFF] Corrects an error when showing a suggestion linked to a deleted budget. If a suggestion is associated to a budget that was deleted, an error was returned because we try to get the name of a budget that doesn't exist. With this fix, the page is shown without errors. Signed-off-by: Paul Poulain --- suggestion/suggestion.pl | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/suggestion/suggestion.pl b/suggestion/suggestion.pl index 44d65ed..cb8c5f9 100755 --- a/suggestion/suggestion.pl +++ b/suggestion/suggestion.pl @@ -184,7 +184,10 @@ if ($op=~/else/) { my $suggestions = &SearchSuggestion($suggestion_ref); foreach my $suggestion (@$suggestions){ - $suggestion->{budget_name}=GetBudget($suggestion->{budgetid})->{budget_name} if $suggestion->{budgetid}; + if($suggestion->{budgetid}) { + my $budget = GetBudget($suggestion->{budgetid}); + $suggestion->{budget_name}=$budget->{budget_name} if $budget; + } foreach my $date qw(suggesteddate manageddate accepteddate){ if ($suggestion->{$date} ne "0000-00-00" && $suggestion->{$date} ne "" ){ $suggestion->{$date}=format_date($suggestion->{$date}) ; -- 1.7.1