Changeset 4982

Show
Ignore:
Timestamp:
11/04/09 07:56:21 (4 weeks ago)
Author:
takayama
Message:

* Do not restore the userpic if author exists. bugid:103000

Location:
branches/greyhound-rc-1/lib/MT
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/greyhound-rc-1/lib/MT/BackupRestore.pm

    r4972 r4982  
    631631            # restore userpic association now 
    632632            my $new_author = $all_objects->{$key}; 
    633             if ( my $userpic_id = $new_author->userpic_asset_id ) { 
    634                 if ( my $new_asset = $all_objects->{'MT::Asset#' . $userpic_id} ) { 
    635                     $new_author->userpic_asset_id( $new_asset->id ); 
     633            if ( !$all_objects->{$key}->{no_overwrite} ) { 
     634                if ( my $userpic_id = $new_author->userpic_asset_id ) { 
     635                    if ( my $new_asset = $all_objects->{'MT::Asset#' . $userpic_id} ) { 
     636                        $new_author->userpic_asset_id( $new_asset->id ); 
     637                    } 
    636638                } 
    637639            } 
  • branches/greyhound-rc-1/lib/MT/BackupRestore/BackupFileHandler.pm

    r4629 r4982  
    120120                            my $old_id = delete $column_data{id}; 
    121121                            $objects->{"$class#$old_id"} = $obj; 
     122                            $objects->{"$class#$old_id"}->{no_overwrite} = 1; 
    122123                            my $child_classes = $obj->properties->{child_classes} || {}; 
    123124                            for my $class (keys %$child_classes) {