[Koha-patches] [PATCH][SIGNED-OFF] Corrects an error when showing a suggestion linked to a deleted budget.
Chris Cormack
chrisc at catalyst.net.nz
Tue Apr 5 04:50:39 CEST 2011
* paul.poulain at biblibre.com (paul.poulain at biblibre.com) wrote:
> From: Frédérick Capovilla <frederick.capovilla at sys-tech.net>
>
> 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.
I need a bug number with this one too please
Chris
>
> Signed-off-by: Paul Poulain <paul.poulain at biblibre.com>
> ---
> 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
>
> _______________________________________________
> Koha-patches mailing list
> Koha-patches at lists.koha-community.org
> http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-patches
> website : http://www.koha-community.org/
> git : http://git.koha-community.org/
> bugs : http://bugs.koha-community.org/
--
Chris Cormack
Catalyst IT Ltd.
+64 4 803 2238
PO Box 11-053, Manners St, Wellington 6142, New Zealand
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: </pipermail/koha-patches/attachments/20110405/3ba3eed7/attachment.pgp>
More information about the Koha-patches
mailing list