Bugzilla – Attachment 74548 Details for
Bug 20620
Warning in moredetail.pl need to be removed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20620: Remove warnings in moredetail.pl
Bug-20620-Remove-warnings-in-moredetailpl.patch (text/plain), 2.50 KB, created by
Jonathan Druart
on 2018-04-19 12:56:50 UTC
(
hide
)
Description:
Bug 20620: Remove warnings in moredetail.pl
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2018-04-19 12:56:50 UTC
Size:
2.50 KB
patch
obsolete
>From c2d69411f205c7ab00f2c27c94400f0b96c90d26 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 19 Apr 2018 09:54:45 -0300 >Subject: [PATCH] Bug 20620: Remove warnings in moredetail.pl > >Since 19995 warnings are displayed in moredetail.pl, we should get rid >of them. > >Test plan: >Hit moredetail.pl with different biblionumbers and confirm you do no >longer see warnings in logs. > >Make sure values for rentalcharge, item type, ccode and replacementprice >are displayed correctly. >--- > catalogue/moredetail.pl | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) > >diff --git a/catalogue/moredetail.pl b/catalogue/moredetail.pl >index 845d10e9e9..3d6bd4ab6c 100755 >--- a/catalogue/moredetail.pl >+++ b/catalogue/moredetail.pl >@@ -123,8 +123,9 @@ my $copynumbers = > > my $itemtypes = { map { $_->{itemtype} => $_ } @{ Koha::ItemTypes->search_with_localization->unblessed } }; > >-$data->{'itemtypename'} = $itemtypes->{$data->{'itemtype'}}->{'translated_description'}; >-$data->{'rentalcharge'} = sprintf( "%.2f", $data->{'rentalcharge'} ); >+$data->{'itemtypename'} = $itemtypes->{ $data->{'itemtype'} }->{'translated_description'} >+ if $data->{itemtype} && exists $itemtypes->{ $data->{itemtype} }; >+$data->{'rentalcharge'} = sprintf( "%.2f", $data->{'rentalcharge'} || 0); # Price formatting should be done template-side > foreach ( keys %{$data} ) { > $template->param( "$_" => defined $data->{$_} ? $data->{$_} : '' ); > } >@@ -132,9 +133,9 @@ foreach ( keys %{$data} ) { > ($itemnumber) and @items = (grep {$_->{'itemnumber'} == $itemnumber} @items); > foreach my $item (@items){ > $item->{object} = Koha::Items->find( $item->{itemnumber} ); >- $item->{'collection'} = $ccodes->{ $item->{ccode} } if ($ccodes); >- $item->{'itype'} = $itemtypes->{ $item->{'itype'} }->{'translated_description'}; >- $item->{'replacementprice'} = sprintf( "%.2f", $item->{'replacementprice'} ); >+ $item->{'collection'} = $ccodes->{ $item->{ccode} } if $ccodes && $item->{ccode} && exists $ccodes->{ $item->{ccode} }; >+ $item->{'itype'} = $itemtypes->{ $item->{'itype'} }->{'translated_description'} if exists $itemtypes->{ $item->{'itype'} }; >+ $item->{'replacementprice'} = sprintf( "%.2f", $item->{'replacementprice'} || 0 ); # Price formatting should be done template-side > if ( defined $item->{'copynumber'} ) { > $item->{'displaycopy'} = 1; > if ( defined $copynumbers->{ $item->{'copynumber'} } ) { >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 20620
:
74548
|
74659
|
75057