Changeset 2011

Show
Ignore:
Timestamp:
04/21/08 21:43:09 (7 months ago)
Author:
bchoate
Message:

Fixes for building indexes through the publish queue. Thanks, Jay. BugId:79403

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/release-35/lib/MT/WeblogPublisher.pm

    r1977 r2011  
    12601260        ## the site_path and the template outfile. 
    12611261        ($file) = $file =~ /(.+)/s; 
    1262         my $finfo; 
    1263         require MT::FileInfo; 
    1264         my @finfos = MT::FileInfo->load( 
     1262        my $finfo = $param{FileInfo};  # available for single template calls 
     1263        unless ( $finfo ) { 
     1264            require MT::FileInfo; 
     1265            my @finfos = MT::FileInfo->load( 
     1266                { 
     1267                    blog_id     => $tmpl->blog_id, 
     1268                    template_id => $tmpl->id 
     1269                } 
     1270            ); 
     1271            if (   ( scalar @finfos == 1 ) 
     1272                && ( $finfos[0]->file_path eq $file ) 
     1273                && ( ( $finfos[0]->url || '' ) eq $rel_url ) ) 
    12651274            { 
    1266                 blog_id     => $tmpl->blog_id, 
    1267                 template_id => $tmpl->id 
    1268             } 
    1269         ); 
    1270         if (   ( scalar @finfos == 1 ) 
    1271             && ( $finfos[0]->file_path eq $file ) 
    1272             && ( ( $finfos[0]->url || '' ) eq $rel_url ) ) 
    1273         { 
    1274             $finfo = $finfos[0]; 
    1275         } 
    1276         else { 
    1277             foreach (@finfos) { $_->remove(); } 
    1278             $finfo = MT::FileInfo->set_info_for_url( 
    1279                 $rel_url, $file, 'index', 
    1280                 { 
    1281                     Blog     => $tmpl->blog_id, 
    1282                     Template => $tmpl->id, 
    1283                 } 
    1284               ) 
    1285               || die "Couldn't create FileInfo because " . MT::FileInfo->errstr; 
     1275                $finfo = $finfos[0]; 
     1276            } 
     1277            else { 
     1278                foreach (@finfos) { $_->remove(); } 
     1279                $finfo = MT::FileInfo->set_info_for_url( 
     1280                    $rel_url, $file, 'index', 
     1281                    { 
     1282                        Blog     => $tmpl->blog_id, 
     1283                        Template => $tmpl->id, 
     1284                    } 
     1285                  ) 
     1286                  || die "Couldn't create FileInfo because " . MT::FileInfo->errstr; 
     1287            } 
    12861288        } 
    12871289        if ( $tmpl->build_dynamic ) { 
     
    14521454            BlogID   => $fi->blog_id, 
    14531455            Template => MT::Template->load( $fi->template_id ), 
     1456            FileInfo => $fi, 
    14541457            Force    => 1, 
    14551458        ) or return; 
     
    17751778    require MT::PublishOption; 
    17761779    my $throttle = MT::PublishOption::get_throttle($fi); 
     1780    return 0 if $throttle->{type} == MT::PublishOption::DISABLED(); 
    17771781    return 1 if $throttle->{type} != MT::PublishOption::ASYNC(); 
    1778     return 0 if $throttle->{type} == MT::PublishOption::DISABLED(); 
    17791782 
    17801783    require MT::TheSchwartz;