Skip to content

Commit

Permalink
Fix error for tracking mode.
Browse files Browse the repository at this point in the history
Piwik class is not available in tracking mode and whenever a plugin fails
to load we should log this. For now I just disable and comment out the line.
  • Loading branch information
halfdan committed Mar 13, 2013
1 parent 3b89dd1 commit d534d4f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/PluginsManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@ public function activatePlugin($pluginName)
$existingPlugins = $this->readPluginsDirectory();
if( array_search($pluginName, $existingPlugins) === false)
{
Piwik::log(sprintf("Unable to find the plugin '%s' in activatePlugin.", $pluginName));
// ToDo: This fails in tracker-mode. We should log this however.
//Piwik::log(sprintf("Unable to find the plugin '%s' in activatePlugin.", $pluginName));
return;
}

Expand Down

6 comments on commit d534d4f

@mattab
Copy link
Member

@mattab mattab commented on d534d4f Mar 14, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, created ticket at: http://dev.piwik.org/trac/ticket/3824

To fix properly, if one day we rewrite the logging mechanism, we should include KISS, and include it Tracker as well (this would deprecate the printDebug() calls)

@blueyed
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@halfdan
Please note that there's another call to Piwik::log (which was the cause of the error in the forum post), in loadPlugin().
This should get commented also.

@halfdan
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@blueyed, good catch. Fixed it! Thank you for the report.

@blueyed
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@halfdan I am not sure, if this is intended, but while the commit above returns, the new one throws an Exception..
Does the new commit (384e248) break tracking, in case the code path gets hit? That should not happen (i.e. Piwik should not completely bail out).

@halfdan
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the way it worked before my initial change to Piwik::log - see https://github.com/piwik/piwik/blob/f419aca5cae09792f879e5570c51da699d658599/core/PluginsManager.php#L371

There are also a few other exceptions that will cause tracking to stop. I agree though, that a missing plugin should not cause tracking to fail. I'll look into it.

@create-renegr
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A fix would be VERY nice. I ran into the same problem. I walked through my config and searched for the non-existing plugin which breaks tracking and removed it from the configs -> works now again. BTW: running 1.11.1

👍

Please sign in to comment.