Changeset 1757
- Timestamp:
- 04/03/08 18:22:41 (23 months ago)
- Location:
- branches/release-33/lib/MT
- Files:
-
- 2 modified
-
App/Search.pm (modified) (2 diffs)
-
Object.pm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/release-33/lib/MT/App/Search.pm
r1726 r1757 66 66 }, 67 67 'sort' => 'authored_on', 68 terms => { status => 2 }, #MT::Entry::RELEASE()68 terms => { status => 2, class => '*' }, #MT::Entry::RELEASE() 69 69 filter_types => { 70 70 author => \&_join_author, … … 342 342 343 343 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 } 345 357 346 358 my $columns = $params->{columns}; -
branches/release-33/lib/MT/Object.pm
r1608 r1757 277 277 } 278 278 elsif (ref $terms eq 'ARRAY') { 279 if (my @class_terms = grep { ref $_ eq 'HASH' && 1 == scalar keys %$_ && $_->{$col} } @$terms) { 280 # Filter out any unlimiting class terms (class = *). 281 @$terms = grep { ref $_ ne 'HASH' || 1 != scalar keys %$_ || !$_->{$col} || $_->{$col} ne '*' } @$terms; 282 283 # The class column has been explicitly given or removed, so don't 284 # add one. 285 return; 286 } 279 287 @$terms = ( { $col => $props->{class_type} } => 'AND' => [ @$terms ] ); 280 281 288 } 282 289 }
