Show
Ignore:
Timestamp:
04/03/08 18:22:41 (20 months ago)
Author:
mpaschal
Message:

Search all kinds of entries when searching entries
BugzID: 75420

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/release-33/lib/MT/App/Search.pm

    r1726 r1757  
    6666                }, 
    6767                'sort'  => 'authored_on', 
    68                 terms   => { status => 2 }, #MT::Entry::RELEASE() 
     68                terms   => { status => 2, class => '*' }, #MT::Entry::RELEASE() 
    6969                filter_types => { 
    7070                    author   => \&_join_author, 
     
    342342 
    343343    my @terms; 
    344     push @terms, \%def_terms if %def_terms; 
     344    if (%def_terms) { 
     345        # If we have a term for the model's class column, add it separately, so 
     346        # array search() doesn't add the default class column term. 
     347        my $type = $app->{searchparam}{Type}; 
     348        my $model_class = MT->model($type); 
     349        if (my $class_col = $model_class->properties->{class_column}) { 
     350            if ($def_terms{$class_col}) { 
     351                push @terms, { $class_col => delete $def_terms{$class_col} }; 
     352            } 
     353        } 
     354 
     355        push @terms, \%def_terms; 
     356    } 
    345357 
    346358    my $columns = $params->{columns};