From 0a43ba114d0fee9a478def455b926121442a0814 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9rick=20Capovilla?= Date: Wed, 30 Mar 2011 12:12:19 -0400 Subject: [PATCH] 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 Signed-off-by: Chris Cormack --- suggestion/suggestion.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/suggestion/suggestion.pl b/suggestion/suggestion.pl index ea3fbf56b2..aa8fad0885 100755 --- a/suggestion/suggestion.pl +++ b/suggestion/suggestion.pl @@ -189,7 +189,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}) ; -- 2.39.5