Changeset 1349

Show
Ignore:
Timestamp:
01/31/08 23:47:47 (22 months ago)
Author:
mpaschal
Message:

Only make the templates in the selected blog static (thanks, Brad)
Rebuild fileinfos if the URLs change, as fileinfos store them too
BugzID: 67300

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/release-29/lib/MT/App/CMS.pm

    r1348 r1349  
    84318431                if ( $dcty eq 'none' ) { 
    84328432                    require MT::Template; 
    8433                     my @tmpls = MT::Template->load({ build_dynamic => 1 }); 
     8433                    my @tmpls = MT::Template->load({ 
     8434                        blog_id       => $obj->id, 
     8435                        build_dynamic => 1, 
     8436                    }); 
    84348437                    for my $tmpl (@tmpls) { 
    84358438                        $tmpl->build_dynamic(0); 
     
    84458448 
    84468449            # If either of the publishing paths changed, rebuild the fileinfos. 
    8447             my $site_root_changed = $app->param('site_path') 
    8448                 && $app->param('site_path') ne $original->site_path; 
    8449             my $archive_root_changed = $app->param('archive_path') 
    8450                 && $app->param('archive_path') ne $original->archive_path; 
    8451             if ($dcty ne 'none' && ($dcty_changed || $site_root_changed 
    8452                 || $archive_root_changed)) { 
     8450            my $path_changed = 0; 
     8451            for my $path_field (qw( site_path archive_path site_url archive_url )) { 
     8452                $path_changed = 1 && last if $app->param($path_field) 
     8453                    && $app->param($path_field) ne $original->$path_field(); 
     8454            } 
     8455            if ($dcty ne 'none' && ($dcty_changed || $path_changed)) { 
    84538456                $app->rebuild( BlogID => $obj->id, NoStatic => 1 ) 
    84548457                    or return $app->publish_error();