Skip to content

Commit

Permalink
[#733 state:resolved] Fixing the "unnamed plugin died with: ERROR" er…
Browse files Browse the repository at this point in the history
…ror message thrown by run_callback in a number of different situations.
  • Loading branch information
jayallen committed Feb 3, 2011
1 parent 27a31da commit 468a605
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/MT.pm
Original file line number Diff line number Diff line change
Expand Up @@ -752,12 +752,11 @@ sub run_callback {
if ( $cb->{internal} ) {
$name = "Internal callback";
}
elsif ( UNIVERSAL::isa( $plugin, 'MT::Plugin' ) ) {
$name = $plugin->name() || $mt->translate("Unnamed plugin");
}
else {
$name = $mt->translate("Unnamed plugin");
elsif ( blessed $plugin and $plugin->isa( 'MT::Component' )) {
$name = $plugin->name();
}
$name ||= $mt->translate("Unnamed plugin");

$mt->log( {
message =>
$mt->translate( "[_1] died with: [_2]", $name, $err ),
Expand Down Expand Up @@ -1515,7 +1514,7 @@ sub _init_plugins_core {
if (@deprecated_perl_init) {
MT->add_callback(
'post_init',
1, undef,
1, $mt,
sub {
MT->_perl_init_plugin_warnings(@deprecated_perl_init);
}
Expand Down Expand Up @@ -1648,6 +1647,7 @@ sub _perl_init_plugin_warnings {
# We need to be more sensitive about the activity log...
# Get the session storing the last warning for perl-init plugins
# If it's over a day old, it doesn't exist.

require MT::Session;
my $sess_terms = {
id => 'Deprecation warning: Perl initialized plugins',
Expand Down

0 comments on commit 468a605

Please sign in to comment.