New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display safe mode when a third party plugin triggers error such as "Call to undefined method Piwik\Menu\MenuTop::add()" #10876

Closed
Firesphere opened this Issue Nov 16, 2016 · 15 comments

Comments

Projects
None yet
8 participants
@Firesphere

Firesphere commented Nov 16, 2016

After updating to beta 3, I get this error message. Nothing more.

@sgiehl

This comment has been minimized.

Show comment
Hide comment
@sgiehl

sgiehl Nov 16, 2016

Member

Where, in which file and line?

Member

sgiehl commented Nov 16, 2016

Where, in which file and line?

@ehajo

This comment has been minimized.

Show comment
Hide comment
@ehajo

ehajo Nov 16, 2016

Same here after update from 3.0.0-b2 to 3.0.0-b3:
Call to undefined method Piwik\Menu\MenuAdmin::add()

Link to screenshot

That screen appears after installing it with auto-update.
Downgrade to b2 is not possible because the screen than say something like "update in process, b3 already installed, ..."

ehajo commented Nov 16, 2016

Same here after update from 3.0.0-b2 to 3.0.0-b3:
Call to undefined method Piwik\Menu\MenuAdmin::add()

Link to screenshot

That screen appears after installing it with auto-update.
Downgrade to b2 is not possible because the screen than say something like "update in process, b3 already installed, ..."

@Firesphere

This comment has been minimized.

Show comment
Hide comment
@Firesphere

Firesphere Nov 16, 2016

Stack trace is empty in my server logs :(

Firesphere commented Nov 16, 2016

Stack trace is empty in my server logs :(

@sgiehl

This comment has been minimized.

Show comment
Hide comment
@sgiehl

sgiehl Nov 16, 2016

Member

Any third party plugins installed?

Member

sgiehl commented Nov 16, 2016

Any third party plugins installed?

@Firesphere

This comment has been minimized.

Show comment
Hide comment
@Firesphere

Firesphere Nov 16, 2016

Found it, took me some grep magic, but it's in PerformanceMonitor and BotTracker module indeed.

Sorry for not getting back sooner, didn't have time.
If you use a third party plugin, run the following grep command to find the usages of the old add method and either comment out the lines, or update them, until the makers of the plugin fix it.
grep -rnw '.' -e "menu->add"

Firesphere commented Nov 16, 2016

Found it, took me some grep magic, but it's in PerformanceMonitor and BotTracker module indeed.

Sorry for not getting back sooner, didn't have time.
If you use a third party plugin, run the following grep command to find the usages of the old add method and either comment out the lines, or update them, until the makers of the plugin fix it.
grep -rnw '.' -e "menu->add"

@ehajo

This comment has been minimized.

Show comment
Hide comment
@ehajo

ehajo Nov 16, 2016

Thank you very much. Was also the BotTracker-Module here on my server.
Changed add to addItem and now it is working again :)

ehajo commented Nov 16, 2016

Thank you very much. Was also the BotTracker-Module here on my server.
Changed add to addItem and now it is working again :)

@sgiehl

This comment has been minimized.

Show comment
Hide comment
@sgiehl

sgiehl Nov 16, 2016

Member

Maybe it would be useful for the plugin developer to know that. Could you create issues in their repos?
e.g. https://github.com/Thomas--F/BotTracker

Member

sgiehl commented Nov 16, 2016

Maybe it would be useful for the plugin developer to know that. Could you create issues in their repos?
e.g. https://github.com/Thomas--F/BotTracker

@Firesphere

This comment has been minimized.

Show comment
Hide comment
@Firesphere

Firesphere Nov 16, 2016

Bottracker is already updated for Piwik 3, but somehow not showing up as an update. So completely uninstall and remove, then upload a zip from the repository fixes the issue as well.

PerformanceMonitor seems to be unmaintained.

Firesphere commented Nov 16, 2016

Bottracker is already updated for Piwik 3, but somehow not showing up as an update. So completely uninstall and remove, then upload a zip from the repository fixes the issue as well.

PerformanceMonitor seems to be unmaintained.

@huye

This comment has been minimized.

Show comment
Hide comment
@huye

huye Nov 16, 2016

I added the following content to the file ( piwik/core/Menu/MenuAdmin.php ):

public function add($menuName, $subMenuName, $url, $order = 50, $tooltip = false) { return parent::addItem($menuName, $subMenuName, $url, $tooltip, $order); }

huye commented Nov 16, 2016

I added the following content to the file ( piwik/core/Menu/MenuAdmin.php ):

public function add($menuName, $subMenuName, $url, $order = 50, $tooltip = false) { return parent::addItem($menuName, $subMenuName, $url, $tooltip, $order); }

@Firesphere

This comment has been minimized.

Show comment
Hide comment
@Firesphere

Firesphere Nov 20, 2016

@huye That kinda defies the whole idea of deprecating and removing the method, doesn't it?

Firesphere commented Nov 20, 2016

@huye That kinda defies the whole idea of deprecating and removing the method, doesn't it?

@tsteur

This comment has been minimized.

Show comment
Hide comment
@tsteur

tsteur Nov 20, 2016

Member

FYI: The plugin BotTracker doesn't show up for Piwik 3 because it currently requires a fixed PHP version of "5.3.10". I will send a PR to fix this

Member

tsteur commented Nov 20, 2016

FYI: The plugin BotTracker doesn't show up for Piwik 3 because it currently requires a fixed PHP version of "5.3.10". I will send a PR to fix this

tsteur added a commit to tsteur/BotTracker that referenced this issue Nov 20, 2016

Require at least PHP 5.3.10
See Thomas--F#48 

We have recently changed the logic and it is now needed to required to add `>=`. Once this PR is merged and a new release is tagged, Piwik 3 users should receive the update for this plugin.

FYI: In Piwik 3 we require PHP 5.5.9, so you could also require a newer PHP version if you wanted (`>=5.5.9`)

refs matomo-org/matomo#10876
@mattab

This comment has been minimized.

Show comment
Hide comment
@mattab

mattab Dec 6, 2016

Member

I'm leaving this issue opened as maybe our Safe mode should have been displayed to let user disable easily plugin. Haven't tried to reproduce but I suspect Safe mode wasn't displayed for you?

Safe mode looks like this: https://media.githubusercontent.com/media/piwik/piwik/3.x-dev/tests/UI/expected-screenshots/UIIntegrationTest_fatal_error_safemode.png

Member

mattab commented Dec 6, 2016

I'm leaving this issue opened as maybe our Safe mode should have been displayed to let user disable easily plugin. Haven't tried to reproduce but I suspect Safe mode wasn't displayed for you?

Safe mode looks like this: https://media.githubusercontent.com/media/piwik/piwik/3.x-dev/tests/UI/expected-screenshots/UIIntegrationTest_fatal_error_safemode.png

@unixfox

This comment has been minimized.

Show comment
Hide comment
@unixfox

unixfox Dec 19, 2016

@mattab Safe mode isn't displayed for me too.

I disabled all of my optional plugins and I found that the plugin Counter caused the problem.

unixfox commented Dec 19, 2016

@mattab Safe mode isn't displayed for me too.

I disabled all of my optional plugins and I found that the plugin Counter caused the problem.

@Sebi94nbg

This comment has been minimized.

Show comment
Hide comment
@Sebi94nbg

Sebi94nbg Dec 20, 2016

You can prevent this issue by disabling the PerformanceMonitor before you update Piwik. Leave it disabled until PerformanceMonitor gets an update, which fixes this issue.

Otherwise, you need to comment out the line plugins/PerformanceMonitor/Menu.php:21 in order to disable the PerformanceMonitor:
// $menu->add('PerformanceMonitor_PerformanceSummary', null, $urlParams, true, 3, $tooltip);

Sebi94nbg commented Dec 20, 2016

You can prevent this issue by disabling the PerformanceMonitor before you update Piwik. Leave it disabled until PerformanceMonitor gets an update, which fixes this issue.

Otherwise, you need to comment out the line plugins/PerformanceMonitor/Menu.php:21 in order to disable the PerformanceMonitor:
// $menu->add('PerformanceMonitor_PerformanceSummary', null, $urlParams, true, 3, $tooltip);

@mattab

This comment has been minimized.

Show comment
Hide comment
@mattab

mattab Dec 26, 2016

Member

in the next Piwik version, the safe mode will be displayed for such errors (done in #11082 ). Closing as it's caused by a third party plugin

Member

mattab commented Dec 26, 2016

in the next Piwik version, the safe mode will be displayed for such errors (done in #11082 ). Closing as it's caused by a third party plugin

@mattab mattab closed this Dec 26, 2016

@mattab mattab added the answered label Dec 26, 2016

@mattab mattab changed the title from Call to undefined method Piwik\Menu\MenuTop::add() to Display safe mode when a third party plugin triggers error such as "Call to undefined method Piwik\Menu\MenuTop::add()" Dec 27, 2016

@mattab mattab added c: Usability and removed answered labels Dec 27, 2016

@mattab mattab added this to the 3.0.1 milestone Dec 27, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment