Bugzilla – Attachment 97163 Details for
Bug 24367
With strict enabled, Search.t is too verbose
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24367: Resolve other uninitialized warns in Search.pm
Bug-24367-Resolve-other-uninitialized-warns-in-Sea.patch (text/plain), 4.97 KB, created by
Marcel de Rooy
on 2020-01-10 08:54:39 UTC
(
hide
)
Description:
Bug 24367: Resolve other uninitialized warns in Search.pm
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2020-01-10 08:54:39 UTC
Size:
4.97 KB
patch
obsolete
>From c86e5be9233c948b6ef1c88e7305bf93fa54ac84 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 10 Jan 2020 08:51:51 +0000 >Subject: [PATCH] Bug 24367: Resolve other uninitialized warns in Search.pm >Content-Type: text/plain; charset=utf-8 > >Use of uninitialized value in hash element at /usr/share/koha/C4/Search.pm line 2074. >Use of uninitialized value in hash element at /usr/share/koha/C4/Search.pm line 2137. >Use of uninitialized value in concatenation (.) or string at /usr/share/koha/C4/Search.pm line 2189. >Use of uninitialized value in hash element at /usr/share/koha/C4/Search.pm line 2213. >Use of uninitialized value in hash element at /usr/share/koha/C4/Search.pm line 2215. >Use of uninitialized value in hash element at /usr/share/koha/C4/Search.pm line 2225. >Use of uninitialized value in hash element at /usr/share/koha/C4/Search.pm line 2226. >--- > C4/Search.pm | 18 ++++++++++-------- > 1 file changed, 10 insertions(+), 8 deletions(-) > >diff --git a/C4/Search.pm b/C4/Search.pm >index d1df39defb..532116d703 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -2071,7 +2071,7 @@ sub searchResults { > foreach my $code ( keys %subfieldstosearch ) { > $item->{$code} = $field->subfield( $subfieldstosearch{$code} ); > } >- $item->{description} = $itemtypes{ $item->{itype} }{translated_description}; >+ $item->{description} = $itemtypes{ $item->{itype} }{translated_description} if $item->{itype}; > > # OPAC hidden items > if ($is_opac) { >@@ -2134,7 +2134,9 @@ sub searchResults { > # items not on loan, but still unavailable ( lost, withdrawn, damaged ) > else { > >- $item->{notforloan}=1 if !$item->{notforloan} && $itemtypes{ C4::Context->preference("item-level_itypes")? $item->{itype}: $oldbiblio->{itemtype} }->{notforloan}; >+ my $itemtype = C4::Context->preference("item-level_itypes")? $item->{itype}: $oldbiblio->{itemtype}; >+ $item->{notforloan} = 1 if !$item->{notforloan} && >+ $itemtype && $itemtypes{ $itemtype }->{notforloan}; > > # item is on order > if ( $item->{notforloan} < 0 ) { >@@ -2184,9 +2186,9 @@ sub searchResults { > $withdrawn_count++ if $item->{withdrawn}; > $itemlost_count++ if $item->{itemlost}; > $itemdamaged_count++ if $item->{damaged}; >- $item_in_transit_count++ if $transfertwhen ne ''; >+ $item_in_transit_count++ if $transfertwhen && $transfertwhen ne ''; > $item_onhold_count++ if $reservestatus eq 'Waiting'; >- $item->{status} = $item->{withdrawn} . "-" . $item->{itemlost} . "-" . $item->{damaged} . "-" . $item->{notforloan}; >+ $item->{status} = ($item->{withdrawn}//q{}) . "-" . ($item->{itemlost}//q{}) . "-" . ($item->{damaged}//q{}) . "-" . ($item->{notforloan}//q{}); > > # can place a hold on a item if > # not lost nor withdrawn >@@ -2210,9 +2212,9 @@ sub searchResults { > $other_items->{$key}->{onhold} = ($reservestatus) ? 1 : 0; > $other_items->{$key}->{notforloan} = GetAuthorisedValueDesc('','',$item->{notforloan},'','',$notforloan_authorised_value) if $notforloan_authorised_value and $item->{notforloan}; > $other_items->{$key}->{count}++ if $item->{$hbranch}; >- $other_items->{$key}->{location} = $shelflocations->{ $item->{location} }; >+ $other_items->{$key}->{location} = $shelflocations->{ $item->{location} } if $item->{location}; > $other_items->{$key}->{description} = $item->{description}; >- $other_items->{$key}->{imageurl} = getitemtypeimagelocation( $search_context->{'interface'}, $itemtypes{ $item->{itype} }->{imageurl} ); >+ $other_items->{$key}->{imageurl} = getitemtypeimagelocation( $search_context->{'interface'}, $itemtypes{ $item->{itype}//q{} }->{imageurl} ); > } > # item is available > else { >@@ -2222,8 +2224,8 @@ sub searchResults { > foreach (qw(branchname itemcallnumber description)) { > $available_items->{$prefix}->{$_} = $item->{$_}; > } >- $available_items->{$prefix}->{location} = $shelflocations->{ $item->{location} }; >- $available_items->{$prefix}->{imageurl} = getitemtypeimagelocation( $search_context->{'interface'}, $itemtypes{ $item->{itype} }->{imageurl} ); >+ $available_items->{$prefix}->{location} = $shelflocations->{ $item->{location} } if $item->{location}; >+ $available_items->{$prefix}->{imageurl} = getitemtypeimagelocation( $search_context->{'interface'}, $itemtypes{ $item->{itype}//q{} }->{imageurl} ); > } > } > } # notforloan, item level and biblioitem level >-- >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 24367
:
96911
|
97096
|
97097
|
97157
|
97158
|
97159
| 97163 |
99113