Changeset 985

Show
Ignore:
Timestamp:
12/22/06 19:01:54 (2 years ago)
Author:
bchoate
Message:

Write more appropriate log messages when upgrading plugins versus MT itself. BugId: 44609

Files:

Legend:

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

    r717 r985  
    235235        my $response = $app->response; 
    236236        $response->{cookie} = { map { $_ => $cookie_obj->{$_} } (keys %$cookie_obj) }; 
    237         $app->log($app->translate("User '[_1]' upgraded database to version [_2]", $author->name, MT->schema_version)); 
    238237    }     
    239238} 
  • branches/wheeljack/lib/MT/Upgrade.pm

    r873 r985  
    14091409sub core_finish { 
    14101410    my $self = shift; 
     1411 
     1412    my $user; 
     1413    if ((ref $App) && ($App->{author})) { 
     1414        $user = $App->{author}; 
     1415    } 
     1416 
    14111417    my $cfg = MT::ConfigMgr->instance; 
    14121418    my $cur_schema = MT->instance->schema_version; 
    14131419    my $old_schema = $cfg->SchemaVersion || 0; 
    1414     $self->progress($self->translate("Database has been upgraded to version [_1].", $cur_schema)) if $cur_schema > $old_schema; 
    1415     $cfg->SchemaVersion( $cur_schema, 1 ); 
     1420    if ($cur_schema > $old_schema) { 
     1421        $self->progress($self->translate("Database has been upgraded to version [_1].", $cur_schema)) ; 
     1422        if ($user && !$DryRun) { 
     1423            MT->log($self->translate("User '[_1]' upgraded database to version [_2]", $user->name, $cur_schema)); 
     1424        } 
     1425        $cfg->SchemaVersion( $cur_schema, 1 ); 
     1426    } 
    14161427 
    14171428    my $plugin_schema = $cfg->PluginSchemaVersion || {}; 
     
    14211432        my $old_plugin_schema = $plugin_schema->{$plugin->{plugin_sig}} || 0; 
    14221433        if ($old_plugin_schema && ($ver > $old_plugin_schema)) { 
    1423             $self->progress($self->translate("Plugin '[_1]' upgraded successfully.", $plugin->name)); 
     1434            $self->progress($self->translate("Plugin '[_1]' upgraded successfully to version [_2] (schema version [_3]).", $plugin->name, $plugin->version || '-', $ver)); 
     1435            if ($user && !$DryRun) { 
     1436                MT->log($self->translate("User '[_1]' upgraded plugin '[_2]' to version [_3] (schema version [_4]).", $user->name, $plugin->name, $plugin->version || '-', $ver)); 
     1437            } 
    14241438        } elsif ($ver && !$old_plugin_schema) { 
    14251439            $self->progress($self->translate("Plugin '[_1]' installed successfully.", $plugin->name)); 
     1440            if ($user && !$DryRun) { 
     1441                MT->log($self->translate("User '[_1]' installed plugin '[_2]', version [_3] (schema version [_4]).", $user->name, $plugin->name, $plugin->version || '-', $ver)); 
     1442            } 
    14261443        } 
    14271444        $plugin_schema->{$plugin->{plugin_sig}} = $ver;