[Koha-patches] [PATCH 04/11] [MT3168] follow-up : remove perl error if the librarian choose no budget

Henri-Damien LAURENT henridamien.laurent at biblibre.com
Fri Mar 26 11:25:34 CET 2010


From: Paul Poulain <paul.poulain at biblibre.com>

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 at biblibre.com>
---
 suggestion/suggestion.pl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/suggestion/suggestion.pl b/suggestion/suggestion.pl
index 96b2869..9023cd2 100755
--- a/suggestion/suggestion.pl
+++ b/suggestion/suggestion.pl
@@ -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}) ;
-- 
1.6.3.3




More information about the Koha-patches mailing list