Changeset 877

Show
Ignore:
Timestamp:
12/11/06 09:20:59 (2 years ago)
Author:
fumiakiy
Message:

* Correctly abort restore operation when there is not a manifest file in the import directory. BugId: 45792, 45810
* Gracefully prevent starting restore operation without XML::XPath and its dependencies. BugId: 45790
* Fixed a bug which incorrectly shows the option to archive in tar and zip when there are required modules missing. BugId: 45804
* Added a message and a link to tell sysadmin how generated backup file will start downloading (automatically) and a manual download link in case automatic download does not work. BugId: 45791

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/wheeljack/lib/MT/App/CMS.pm

    r876 r877  
    1092210922    $param{system_overview_nav} = 1; 
    1092310923    $param{nav_backup} = 1; 
     10924    my $missing_tgz = 0; 
    1092410925    eval "require Archive::Tar;"; 
     10926    $missing_tgz = 1 if $@; 
    1092510927    eval "require Compress::Zlib;"; 
    10926     $param{targz} = $@ ? 0 : 1; 
     10928    $missing_tgz = 1 if $@; 
     10929    $param{targz} = !$missing_tgz; 
     10930    my $missing_zip = 0; 
    1092710931    eval "require Archive::Zip;"; 
     10932    $missing_zip = 1 if $@; 
    1092810933    eval "require IO::String;"; 
    10929     $param{zip} = $@ ? 0 : 1; 
     10934    $missing_zip = 1 if $@; 
     10935    $param{zip} = !$missing_zip; 
     10936 
     10937    eval "require XML::XPath"; 
     10938    $param{missing_xpath} = 1 if $@; 
    1093010939 
    1093110940    $app->build_page('backup_restore.tmpl', \%param); 
     
    1110511114            if ('0' eq $archive) { 
    1110611115                $param->{files_loop} = \@files; 
     11116                $param->{tempdir} = $temp_dir; 
    1110711117                $app->_backup_finisher($fname, $param); 
    1110811118            } elsif ('1' eq $archive) { # tar.gz 
  • branches/wheeljack/lib/MT/App/Wizard.pm

    r799 r877  
    3939    [ 'IO::String', 0, 0, 'IO::String is required in order to archive files in backup/restore operation.', 'I/O String'], 
    4040    [ 'Archive::Zip', 0, 0, 'Archive::Zip is required in order to archive files in backup/restore operation.', 'Archive Zip'], 
     41    [ 'XML::XPath', 0, 0, 'XML::XPath and/or its dependencies is required in order to restore.', 'XML XPath'], 
    4142); 
    4243 
     
    595596        my($mod, $ver, $req, $desc, $name) = @$ref; 
    596597        eval("use $mod" . ($ver ? " $ver;" : ";")); 
    597         if ($@) { 
     598        if ($@ || !($mod->VERSION)) { 
    598599            push @missing, { module => $mod, 
    599600                             version => $ver, 
  • branches/wheeljack/lib/MT/BackupRestore.pm

    r847 r877  
    261261    unless ($manifest) { 
    262262        $$error = MT->translate("No manifest file could be found in your import directory [_1].", $dir); 
    263         return 0
     263        return undef
    264264    } 
    265265 
  • branches/wheeljack/lib/MT/L10N/en_us.pm

    r862 r877  
    4747    '_USAGE_BACKUP_FILES' => 'TBD', 
    4848    '_USAGE_RESTORE' => 'TBD', 
    49     '_BACKUP_TEMPDIR_WARNING' => 'Requesed data backed up successfully.  Make sure that you download and <strong>then delete</strong> files listed above from [_1] <strong>immediately</strong> because backup files contain sensitive information.', 
     49    '_BACKUP_TEMPDIR_WARNING' => 'Requesed data backed up successfully in the [_1] directory.  Make sure that you download and <strong>then delete</strong> files listed above from [_1] <strong>immediately</strong> because backup files contain sensitive information.', 
     50    '_BACKUP_DOWNLOAD_MESSAGE' => 'Downloading of the backup file will start automatically in a few seconds.  If for some reason it does not, click <a href=\'#\' onclick=\'submit_form()\'>here</a> to start downloading manually.  Please note that you can download the backup file only once for a session.', 
    5051    '_USAGE_BOOKMARKLET_1' => 'Setting up QuickPost to post to Movable Type allows you to perform one-click posting and publishing without ever entering through the main Movable Type interface.', 
    5152    '_USAGE_BOOKMARKLET_2' => 'Movable Type\'s QuickPost structure allows you to customize the layout and fields on your QuickPost page. For example, you may wish to add the ability to add excerpts through the QuickPost window. By default, a QuickPost window will always have: a pulldown menu for the weblog to post to; a pulldown menu to select the Post Status (Draft or Publish) of the new entry; a text entry box for the Title of the entry; and a text entry box for the entry body.', 
  • branches/wheeljack/mt-check.cgi.pre

    r797 r877  
    234234 
    235235    [ 'Archive::Zip', 0, 0, translate('Archive::Zip is required in order to archive files in backup/restore operation.')], 
     236 
     237    [ 'XML::XPath', 0, 0, translate('XML::XPath and/or its dependencies is required in order to restore.')], 
    236238); 
    237239 
     
    321323            ($ver ? " (version &gt;= $ver)" : "") . "</h3>"; 
    322324        eval("use $mod" . ($ver ? " $ver;" : ";")); 
    323         if ($@) { 
     325        if ($@ || !($mod->VERSION)) { 
    324326            $is_good = 0 if $req; 
    325327            my $msg = $ver ? 
  • branches/wheeljack/tmpl/cms/backup_end.tmpl

    r838 r877  
    4343</form> 
    4444<script type="text/javascript"> 
     45var timer; 
     46 
    4547function submit_form() { 
     48    window.clearTimeout(timer); 
    4649    var f = document['file_download']; 
    4750    if (f) { 
     
    5053} 
    5154 
    52 var timer; 
    53 timer = window.setTimeout("submit_form()", 1000); 
     55timer = window.setTimeout("submit_form()", 3000); 
    5456</script> 
     57<p><strong><MT_TRANS phrase="_BACKUP_DOWNLOAD_MESSAGE"></strong></p> 
    5558</TMPL_IF> 
    5659<TMPL_ELSE> 
  • branches/wheeljack/tmpl/cms/backup_restore.tmpl

    r856 r877  
    8383</div> 
    8484<div id="restore-panel" style="display: none;"> 
    85  
     85<TMPL_IF NAME=MISSING_XPATH> 
     86<div class="error-message"><MT_TRANS phrase="Perl module XML::XPath and/or its dependencies is missing - Movable Type can not restore system without it."></div> 
     87<TMPL_ELSE> 
    8688<form method="post" enctype="multipart/form-data" action="<TMPL_VAR NAME=SCRIPT_URL>"> 
    8789<input type="hidden" name="__mode" value="restore" /> 
     
    119121</fieldset> 
    120122</form> 
    121  
     123</TMPL_IF> 
    122124</div> 
    123125<div id="bottom"></div>