View | Details | Raw Unified | Return to bug 18400
Collapse All | Expand All

(-)a/opac/opac-search.pl (-2 / +4 lines)
Lines 229-234 foreach my $itemtype ( keys %{$itemtypes} ) { Link Here
229
    $itemtypes->{$itemtype}->{translated_description} =
229
    $itemtypes->{$itemtype}->{translated_description} =
230
            ( $translated_description ) ? $translated_description : $itemtypes->{$itemtype}->{description};
230
            ( $translated_description ) ? $translated_description : $itemtypes->{$itemtype}->{description};
231
}
231
}
232
my $itemtypes_copy = { %$itemtypes }; #Sometime itemtypes can be corrupted in advanced_srch_type loop
233
                                      #Making a copy ensure it is clean
232
# the index parameter is different for item-level itemtypes
234
# the index parameter is different for item-level itemtypes
233
my $itype_or_itemtype = (C4::Context->preference("item-level_itypes"))?'itype':'itemtype';
235
my $itype_or_itemtype = (C4::Context->preference("item-level_itypes"))?'itype':'itemtype';
234
my @advancedsearchesloop;
236
my @advancedsearchesloop;
Lines 254-260 foreach my $advanced_srch_type (@advanced_search_types) { Link Here
254
   if ($advanced_srch_type eq 'itemtypes') {
256
   if ($advanced_srch_type eq 'itemtypes') {
255
   # itemtype is a special case, since it's not defined in authorized values
257
   # itemtype is a special case, since it's not defined in authorized values
256
        my @itypesloop;
258
        my @itypesloop;
257
        foreach my $thisitemtype ( sort {$itemtypes->{$a}->{translated_description} cmp $itemtypes->{$b}->{translated_description} } keys %$itemtypes ) {
259
        my @sorted_itemtypes = ( sort {$itemtypes->{$a}->{translated_description} cmp $itemtypes->{$b}->{translated_description} } keys %$itemtypes_copy );
260
        foreach my $thisitemtype ( @sorted_itemtypes ) {
258
            next if $hidingrules->{itype} && any { $_ eq $thisitemtype } @{$hidingrules->{itype}};
261
            next if $hidingrules->{itype} && any { $_ eq $thisitemtype } @{$hidingrules->{itype}};
259
            next if $hidingrules->{itemtype} && any { $_ eq $thisitemtype } @{$hidingrules->{itemtype}};
262
            next if $hidingrules->{itemtype} && any { $_ eq $thisitemtype } @{$hidingrules->{itemtype}};
260
	    my %row =(  number=>$cnt++,
263
	    my %row =(  number=>$cnt++,
261
- 

Return to bug 18400