Changeset 962

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

* Implemented the I18N to restore operation. BugId: 46087
* Fixed so restore will correctly restore parent ids of objects. BugId: 46088
* Fixed to correctly de-reference a variable. BugId: 46089

Files:

Legend:

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

    r961 r962  
    1131411314        return 0; 
    1131511315    } 
    11316     if ($errormsg) { 
     11316    if ($$errormsg) { 
    1131711317        $app->log({ 
    11318             message => $errormsg, 
     11318            message => $$errormsg, 
    1131911319            level => MT::Log::ERROR(), 
    1132011320            class => 'system', 
  • branches/wheeljack/lib/MT/BackupRestore.pm

    r951 r962  
    327327        my $voldir =  "$vol$dir"; 
    328328        # we do need decode_utf8 here 
    329         $errors->{$id} = MT::I18N::decode_utf8(MT->translate('[_1] is not writable.', $voldir)); 
     329        $errors->{$id} = MT->translate('[_1] is not writable.', MT::I18N::utf8_off($voldir)); 
    330330    } else { 
    331331        my $filename = "$id-" . $asset_element->{name}; 
     
    847847sub parent_names { 
    848848    my $obj = shift; 
    849     { author => 'MT::Author', blog => 'MT::Blog' }; 
     849    my $parents = { 
     850        author => 'MT::Author', 
     851        blog => 'MT::Blog' 
     852    }; 
     853    $parents; 
    850854} 
    851855 
  • branches/wheeljack/lib/MT/BackupRestore/BackupFileHandler.pm

    r951 r962  
    8686 
    8787                my $obj = $class->new; 
    88                 my %column_data = map { $attrs->{$_}->{LocalName} => $attrs->{$_}->{Value} } keys(%$attrs); 
    89                 $obj->set_values(\%column_data); 
     88                my %column_data = map { $attrs->{$_}->{LocalName} =>  
     89                        MT::I18N::encode_text(MT::I18N::utf8_off($attrs->{$_}->{Value}), 'utf-8') 
     90                    } keys(%$attrs); 
    9091                $callback->(MT->translate("Restoring [_1]...\n", $class)); 
    9192                my $success = $obj->restore_parent_ids(\%column_data, $objects); 
    9293                if ($success) { 
     94                    $obj->set_values(\%column_data); 
    9395                    $self->{current} = $obj; 
    9496                } else { 
    95                     $callback->(MT->translate("Restoring [_1] (ID: [_2]) was deferred because its parents objects have not been restored yet.\n", $class, $column_data{id})); 
     97                    $callback->( 
     98                        MT->translate("Restoring [_1] (ID: [_2]) was deferred because its parents objects have not been restored yet.\n",  
     99                            $class, $column_data{id}) 
     100                    ); 
    96101                    $deferred->{$class . '#' . $column_data{id}} = 1; 
    97102                    $self->{deferred} = $deferred; 
     
    113118    return if $self->{skip}; 
    114119    return if !exists($self->{current}); 
    115 use Data::Dumper; 
    116120    if (my $text_data = $self->{current_text}) { 
    117121        push @$text_data, $data->{Data}; 
     
    135139            my $text; 
    136140            $text .= $_ foreach @{$self->{current_text}}; 
     141            $text = MT::I18N::encode_text(MT::I18N::utf8_off($text), 'utf-8'); 
    137142            $obj->column($column_name, $text); 
    138143            delete $self->{current_text}; 
  • branches/wheeljack/lib/MT/BackupRestore/ManifestFileHandler.pm

    r951 r962  
    4141    my $name = $data->{LocalName}; 
    4242    my %attrs = map { 
    43         $data->{Attributes}->{$_}->{LocalName} => $data->{Attributes}->{$_}->{Value} 
     43        $data->{Attributes}->{$_}->{LocalName} =>  
     44            MT::I18N::encode_text(MT::I18N::utf8_off($data->{Attributes}->{$_}->{Value}), 'utf-8') 
    4445    } keys(%{$data->{Attributes}}); 
    4546    my $ns = $data->{NamespaceURI};