Changeset 1348

Show
Ignore:
Timestamp:
01/31/08 02:09:10 (17 months ago)
Author:
mpaschal
Message:

Don't rebuild fileinfos except when they should have changed
BugzID: 67300

Files:
1 modified

Legend:

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

    r1346 r1348  
    84268426    if ( $screen eq 'cfg_archives' ) { 
    84278427        if ( my $dcty = $app->param('dynamicity') ) { 
    8428             if ( $dcty eq 'none' ) { 
    8429                 require MT::Template; 
    8430                 my @tmpls = MT::Template->load({ build_dynamic => 1}); 
    8431                 for my $tmpl (@tmpls) { 
    8432                     $tmpl->build_dynamic(0); 
    8433                     $tmpl->save; 
     8428            my $dcty_changed = $dcty ne $original->custom_dynamic_templates ? 1 : 0; 
     8429 
     8430            if ($dcty_changed) { 
     8431                if ( $dcty eq 'none' ) { 
     8432                    require MT::Template; 
     8433                    my @tmpls = MT::Template->load({ build_dynamic => 1 }); 
     8434                    for my $tmpl (@tmpls) { 
     8435                        $tmpl->build_dynamic(0); 
     8436                        $tmpl->save; 
     8437                    } 
    84348438                } 
    8435             } 
    8436             else { 
    84378439                $app->update_dynamicity( 
    84388440                    $obj, 
     
    84408442                    $app->param('dynamic_conditional') ? 1 : 0 
    84418443                ); 
     8444            } 
     8445 
     8446            # 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)) { 
    84428453                $app->rebuild( BlogID => $obj->id, NoStatic => 1 ) 
    84438454                    or return $app->publish_error(); 
    84448455            } 
    84458456        } 
    8446         $app->cfg_archives_save($obj); 
     8457 
     8458        $app->cfg_archives_save($obj) or return; 
    84478459    } 
    84488460    if ( $screen eq 'cfg_prefs' ) {