Bugzilla – Attachment 62232 Details for
Bug 18400
Noisy warns in opac-search.pl during itemtype sorting
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18400 - Noisy warns in opac-search.pl during itemtype sorting
Bug-18400---Noisy-warns-in-opac-searchpl-during-it.patch (text/plain), 2.16 KB, created by
Marc Véron
on 2017-04-17 20:05:28 UTC
(
hide
)
Description:
Bug 18400 - Noisy warns in opac-search.pl during itemtype sorting
Filename:
MIME Type:
Creator:
Marc Véron
Created:
2017-04-17 20:05:28 UTC
Size:
2.16 KB
patch
obsolete
>From 201ab32e067b8faefaa2828773e8c89d0cda9be4 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 7 Apr 2017 12:51:49 -0400 >Subject: [PATCH] Bug 18400 - Noisy warns in opac-search.pl during itemtype > sorting >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >To fix the warns we use a copy of itemtypes which is not touched by >other code > >To test: >Apply patches >Ensure search still works > >Followed test plan, search works as expected. >Signed-off-by: Marc Véron <veron@veron.ch> >--- > opac/opac-search.pl | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > >diff --git a/opac/opac-search.pl b/opac/opac-search.pl >index a6d205a..3d034ab 100755 >--- a/opac/opac-search.pl >+++ b/opac/opac-search.pl >@@ -229,6 +229,8 @@ foreach my $itemtype ( keys %{$itemtypes} ) { > $itemtypes->{$itemtype}->{translated_description} = > ( $translated_description ) ? $translated_description : $itemtypes->{$itemtype}->{description}; > } >+my $itemtypes_copy = { %$itemtypes }; #Sometime itemtypes can be corrupted in advanced_srch_type loop >+ #Making a copy ensure it is clean > # the index parameter is different for item-level itemtypes > my $itype_or_itemtype = (C4::Context->preference("item-level_itypes"))?'itype':'itemtype'; > my @advancedsearchesloop; >@@ -254,7 +256,8 @@ foreach my $advanced_srch_type (@advanced_search_types) { > if ($advanced_srch_type eq 'itemtypes') { > # itemtype is a special case, since it's not defined in authorized values > my @itypesloop; >- foreach my $thisitemtype ( sort {$itemtypes->{$a}->{translated_description} cmp $itemtypes->{$b}->{translated_description} } keys %$itemtypes ) { >+ my @sorted_itemtypes = ( sort {$itemtypes->{$a}->{translated_description} cmp $itemtypes->{$b}->{translated_description} } keys %$itemtypes_copy ); >+ foreach my $thisitemtype ( @sorted_itemtypes ) { > next if $hidingrules->{itype} && any { $_ eq $thisitemtype } @{$hidingrules->{itype}}; > next if $hidingrules->{itemtype} && any { $_ eq $thisitemtype } @{$hidingrules->{itemtype}}; > my %row =( number=>$cnt++, >-- >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 18400
:
61976
|
62224
|
62232
|
63416
|
63417
|
64718