Show
Ignore:
Timestamp:
08/27/08 05:39:25 (15 months ago)
Author:
fumiakiy
Message:

Run through the process and do not return the error when search string was not specified to mt-search, to enable MTNoSearch tag again. BugId:81304

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/lib/MT/App/Search.pm

    r2877 r2991  
    273273        return $out; 
    274274    } 
    275  
    276     my @arguments = $app->search_terms(); 
    277     return $app->error( $app->errstr ) if $app->errstr; 
    278  
    279     $count = 0; 
    280275    my $iter; 
    281     if (@arguments) { 
    282         ( $count, $iter ) = $app->execute(@arguments); 
    283         return $app->error( $app->errstr ) unless $iter; 
    284  
    285         $app->run_callbacks( 'search_post_execute', $app, \$count, \$iter ); 
     276    if ( $app->param('searchTerms') || $app->param('search') ) { 
     277        my @arguments = $app->search_terms(); 
     278        return $app->error( $app->errstr ) if $app->errstr; 
     279 
     280        $count = 0; 
     281        if (@arguments) { 
     282            ( $count, $iter ) = $app->execute(@arguments); 
     283            return $app->error( $app->errstr ) unless $iter; 
     284 
     285            $app->run_callbacks( 'search_post_execute', $app, \$count, \$iter ); 
     286        } 
    286287    } 
    287288 
     
    345346    my $q   = $app->param; 
    346347 
    347     my $search_string = $q->param('searchTerms') || $q->param('search') 
    348         or return $app->errtrans('No search term was specified.'); 
     348    my $search_string = $q->param('searchTerms') || $q->param('search'); 
    349349    $app->{search_string} = $search_string; 
    350350    my $offset = $q->param('startIndex') || $q->param('offset') || 0;