Bugzilla – Attachment 75057 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.65 KB, created by
Marcel de Rooy
on 2018-05-04 09:41:46 UTC
(
hide
)
Description:
Bug 20620: Remove warnings in moredetail.pl
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2018-05-04 09:41:46 UTC
Size:
2.65 KB
patch
obsolete
>From 0b53dd2462f089e196549f5868d8df77d7e09cca 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 >Content-Type: text/plain; charset=utf-8 > >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. > >Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > catalogue/moredetail.pl | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) > >diff --git a/catalogue/moredetail.pl b/catalogue/moredetail.pl >index 845d10e..3d6bd4a 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.1.4
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