follow-up : remove perl error if the librarian choose no budget
authorPaul Poulain <paul.poulain@biblibre.com>
Fri, 26 Mar 2010 10:25:34 +0000 (11:25 +0100)
committerGalen Charlton <gmcharlt@gmail.com>
Fri, 23 Apr 2010 11:00:59 +0000 (07:00 -0400)
the librarian can enter the suggestion without selecting any budget.
Searching the budget name in this case resulted in a Perl error

Signed-off-by: Henri-Damien LAURENT <henridamien.laurent@biblibre.com>
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>

suggestion/suggestion.pl

index 96b2869..9023cd2 100755 (executable)
@@ -167,7 +167,7 @@ if ($op=~/else/) {
     
         my $suggestions = &SearchSuggestion($suggestion_ref);
         foreach my $suggestion (@$suggestions){
-            $suggestion->{budget_name}=GetBudget($suggestion->{budgetid})->{budget_name};
+            $suggestion->{budget_name}=GetBudget($suggestion->{budgetid})->{budget_name} if $suggestion->{budgetid};
             foreach my $date qw(suggesteddate manageddate accepteddate){
                 if ($suggestion->{$date} ne "0000-00-00" && $suggestion->{$date} ne "" ){
                 $suggestion->{$date}=format_date($suggestion->{$date}) ;