Changeset 1984

Show
Ignore:
Timestamp:
04/18/08 12:08:50 (22 months ago)
Author:
fumiakiy
Message:

Changed the way to show progress message for MT::Author so the empty message won't overwrite the previous valid messages. BugId:69074

Files:
1 modified

Legend:

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

    r1948 r1984  
    167167    my $counter = 1; 
    168168    my $bytes = 0; 
    169     my %author_ids_seen; 
     169    my %authors_seen; 
     170    my $author_pkg = MT->model('author'); 
    170171    for my $class_hash (@$obj_to_backup) { 
    171172        my ($class, $term_arg) = each(%$class_hash); 
     
    217218                } 
    218219                $count++; 
    219                 if ( ( $class eq MT->model('author') ) 
    220                   && ( exists $author_ids_seen{$object->id} ) ) { 
     220                if ( ( $class eq $author_pkg ) 
     221                  && ( exists $authors_seen{$object->id} ) ) { 
    221222                    next; 
    222223                } 
     
    227228                    $bytes = 0; 
    228229                } 
    229                 if ( $class eq MT->model('author') ) { 
     230                if ( $class eq $author_pkg ) { 
    230231                    # Authors may be duplicated because of how terms and args are created. 
    231                     $author_ids_seen{$object->id} = 1; 
     232                    $authors_seen{$object->id} = 1; 
    232233                } elsif ( $class->datasource eq 'asset' ) { 
    233234                    $files->{$object->id} = [$object->url, $object->file_path, $object->file_name]; 
     
    238239                if $records && ($records % 100 == 0); 
    239240        } 
    240         if ($records) { 
     241        if ( $class eq $author_pkg && %authors_seen ) { 
     242            my $count = scalar(keys %authors_seen); 
     243            $progress->($state . " " . MT->translate("[_1] records backed up.", $count), $class->class_type || $class->datasource); 
     244        } elsif ($records) { 
    241245            $progress->($state . " " . MT->translate("[_1] records backed up.", $records), $class->class_type || $class->datasource); 
    242246        } else {