Changeset 2564

Show
Ignore:
Timestamp:
06/13/08 03:20:08 (20 months ago)
Author:
fumiakiy
Message:

Do not proceed restoring from the backup which was from *different* version of MT (not just newer, but different version would not be allowed). BugId:80102

Location:
branches/release-40
Files:
5 modified

Legend:

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

    r2548 r2564  
    334334    ); }; 
    335335 
    336     MT->run_callbacks('restore', $objects, $deferred, $errors, $callback); 
     336    unless ( $@ ) { 
     337        MT->run_callbacks('restore', $objects, $deferred, $errors, $callback); 
     338    } 
    337339    $$errormsg = join('; ', @$errors); 
    338340    ($deferred, $blog_ids); 
     
    433435    } 
    434436 
    435     MT->run_callbacks('restore', \%objects, $deferred, $errors, $callback); 
     437    unless ( $@ ) { 
     438        MT->run_callbacks('restore', \%objects, $deferred, $errors, $callback); 
     439    } 
    436440    my $blog_ids = scalar(@blog_ids) ? \@blog_ids : undef; 
    437441    my $asset_ids = scalar(@asset_ids) ? \@asset_ids : undef; 
  • branches/release-40/lib/MT/BackupRestore/BackupFileHandler.pm

    r2298 r2564  
    4242        die MT->translate('Uploaded file was not a valid Movable Type backup manifest file.') 
    4343            if !(('movabletype' eq $name) && (MT::BackupRestore::NS_MOVABLETYPE() eq $ns)); 
    44         unless ($self->{ignore_schema_conflicts}) { 
     44        #unless ($self->{ignore_schema_conflicts}) { 
    4545            my $schema = $attrs->{'{}schema_version'}->{Value}; 
    46             if (('ignore' ne $self->{schema_version}) && ($schema > $self->{schema_version})) { 
     46            #if (('ignore' ne $self->{schema_version}) && ($schema > $self->{schema_version})) { 
     47            if ( $schema != $self->{schema_version} ) { 
    4748                $self->{critical} = 1; 
    48                 my $message = MT->translate('Uploaded file was backed up from Movable Type with the newer schema version ([_1]) than the one in this system ([_2]).  It is not safe to restore the file to this version of Movable Type.', MT::I18N::encode_text(MT::I18N::utf8_off($schema), 'utf-8'), $self->{schema_version}); 
     49                my $message = MT->translate('Uploaded file was backed up from Movable Type but the different schema version ([_1]) from the one in this system ([_2]).  It is not safe to restore the file to this version of Movable Type.', MT::I18N::encode_text(MT::I18N::utf8_off($schema), 'utf-8'), $self->{schema_version}); 
    4950                MT->log({  
    5051                    message => $message, 
     
    5556                die $message; 
    5657            } 
    57         } 
     58        #} 
    5859        $self->{start} = 0; 
    5960        return 1; 
  • branches/release-40/lib/MT/CMS/Tools.pm

    r2498 r2564  
    15971597    my ( $fh, $errormsg ) = @_; 
    15981598    my $q = $app->param; 
    1599     my $schema_version = 
    1600       $q->param('ignore_schema_conflict') 
    1601       ? 'ignore' 
    1602       : $app->config('SchemaVersion'); 
     1599    my $schema_version = $app->config->SchemaVersion; 
     1600    #my $schema_version = 
     1601    #  $q->param('ignore_schema_conflict') 
     1602    #  ? 'ignore' 
     1603    #  : $app->config('SchemaVersion'); 
    16031604    my $overwrite_template = $q->param('overwrite_global_templates') ? 1 : 0; 
    16041605 
     
    16551656 
    16561657    my $q = $app->param; 
    1657     my $schema_version = 
    1658       $q->param('ignore_schema_conflict') 
    1659       ? 'ignore' 
    1660       : $app->config('SchemaVersion'); 
     1658    my $schema_version = $app->config->SchemaVersion; 
     1659    #my $schema_version = 
     1660    #  $q->param('ignore_schema_conflict') 
     1661    #  ? 'ignore' 
     1662    #  : $app->config('SchemaVersion'); 
    16611663 
    16621664    my $overwrite_template = $q->param('overwrite_global_templates') ? 1 : 0; 
     
    17641766    $param->{last}        = scalar(@$files) ? 0 : ( scalar(@$assets) ? 0 : 1 ); 
    17651767    $param->{open_dialog} = 1; 
    1766     $param->{schema_version} = 
    1767       $q->param('ignore_schema_conflict') 
    1768       ? 'ignore' 
    1769       : $app->config('SchemaVersion'); 
     1768    $param->{schema_version} = $app->config->SchemaVersion; 
     1769    #$param->{schema_version} = 
     1770    #  $q->param('ignore_schema_conflict') 
     1771    #  ? 'ignore' 
     1772    #  : $app->config('SchemaVersion'); 
    17701773    $param->{overwrite_templates} = $q->param('overwrite_global_templates') ? 1 : 0; 
    17711774 
  • branches/release-40/lib/MT/L10N/ja.pm

    r2538 r2564  
    864864 
    865865## lib/MT/BackupRestore/BackupFileHandler.pm 
    866         'Uploaded file was backed up from Movable Type with the newer schema version ([_1]) than the one in this system ([_2]).  It is not safe to restore the file to this version of Movable Type.' => 'アップロヌドされたファむルはこのシステムのバヌゞョン([_2])より新しいバヌゞョン([_1])でバックアップされおいたす。このファむルを䜿っお埩å 
    867 ƒã™ã‚‹ã“ずは掚奚されたせん。', 
     866        'Uploaded file was backed up from Movable Type but the different schema version ([_1]) from the one in this system ([_2]).  It is not safe to restore the file to this version of Movable Type.' => 'アップロヌドされたファむルはこのシステムのバヌゞョン([_2])ずは異なるバヌゞョン([_1])でバックアップされおいたす。このファむルを䜿っお埩å 
     867ƒã™ã‚‹ã“ずはできたせん。', 
    868868        '[_1] is not a subject to be restored by Movable Type.' => '[_1]はMovable Typeで埩å 
    869869ƒã™ã‚‹å¯Ÿè±¡ã«ã¯å«ãŸã‚ŒãŠã„たせん。', 
  • branches/release-40/tmpl/cms/restore.tmpl

    r1212 r2564  
    3535                <input name="file" type="file" size="50" /> 
    3636        </mtapp:setting> 
     37        <mt:ignore><!-- disable the feature to ignore schema conflict. 
    3738        <mtapp:setting 
    3839            id="ignore_schema_conflict" 
     
    4344                <label for="ignore_schema_conflict"><__trans phrase="Ignore schema version conflicts"></label> 
    4445        </mtapp:setting> 
     46        --></mt:ignore> 
    4547        <mtapp:setting 
    4648            id="overwrite_global_templates"