Changeset 2991 for trunk/lib/MT/App/Search.pm
- Timestamp:
- 08/27/08 05:39:25 (15 months ago)
- Files:
-
- 1 modified
-
trunk/lib/MT/App/Search.pm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/MT/App/Search.pm
r2877 r2991 273 273 return $out; 274 274 } 275 276 my @arguments = $app->search_terms();277 return $app->error( $app->errstr ) if $app->errstr;278 279 $count = 0;280 275 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 } 286 287 } 287 288 … … 345 346 my $q = $app->param; 346 347 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'); 349 349 $app->{search_string} = $search_string; 350 350 my $offset = $q->param('startIndex') || $q->param('offset') || 0;
