Changeset 2640

Show
Ignore:
Timestamp:
06/25/08 06:48:43 (20 months ago)
Author:
fumiakiy
Message:

Do not bother executing queries against ObjectTag if there is no tag to consider. BugId:80312

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/release-40/lib/MT/Template/ContextHandlers.pm

    r2633 r2640  
    77127712            my $preloader = sub { 
    77137713                my ($entry_id) = @_; 
     7714                my %map; 
     7715                return \%map unless @tag_ids; 
    77147716                my $terms = {  
    77157717                    tag_id => \@tag_ids, 
     
    77247726                }; 
    77257727                my @ot_ids = MT::ObjectTag->load($terms, $args); 
    7726                 my %map; 
    77277728                $map{$_->tag_id} = 1 for @ot_ids; 
    77287729                \%map; 
    77297730            }; 
    7730             if (!$entries) { 
     7731            if (!$entries && @tag_ids) { 
    77317732                if ($tag_arg !~ m/\bNOT\b/i) { 
    77327733                    $args{join} = MT::ObjectTag->join_on( 'object_id', {