Item13858: MultiSearchPlugin fails when a sub-search returns no results

pencil
Priority: Normal
Current State: Closed
Released In: n/a
Target Release: n/a
Applies To: Extension
Component: MultiSearchPlugin
Branches: master
Reported By: KennethLavrsen
Waiting For: KennethLavrsen
Last Change By: KennethLavrsen
If the MultiSearchPlugin searches for several criteria (sub searches) and one of them returns no results the plugins fails in trying to sort an array without a valid reference

The fix is to test for the existance of the array before trying to sort.

In MultiSearchPlugin.pm around line 458 add the next unless......

        for ( my $i = 1 ; $i <= $searchCounter ; $i++ ) {
            next unless defined $sortedIndexes[$i];                     
            @{$sortedIndexes[$i]} = sort { $a->{indexvalue} <=> $b->{indexvalue} }
                                    @{$sortedIndexes[$i]};
        }

I will check this in when I am at my development machine.

-- KennethLavrsen - 18 Nov 2015

 
Topic revision: r2 - 07 Dec 2015, KennethLavrsen
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy