Skip to content
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
Labels
c: Usability For issues that let users achieve a defined goal more effectively or efficiently.
Milestone

Comments

@Firesphere
Copy link

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

@sgiehl
Copy link
Member

sgiehl commented Nov 16, 2016

Where, in which file and line?

@ehajo
Copy link

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
Copy link
Author

Stack trace is empty in my server logs :(

@sgiehl
Copy link
Member

sgiehl commented Nov 16, 2016

Any third party plugins installed?

@Firesphere
Copy link
Author

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
Copy link

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
Copy link
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
Copy link
Author

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
Copy link

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
Copy link
Author

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

@tsteur
Copy link
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

@mattab
Copy link
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
Copy link

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.

@Sebbo94BY
Copy link

Sebbo94BY 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
Copy link
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 as completed Dec 26, 2016
@mattab mattab added the answered For when a question was asked and we referred to forum or answered it. label Dec 26, 2016
@mattab mattab changed the title Call to undefined method Piwik\Menu\MenuTop::add() 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 For issues that let users achieve a defined goal more effectively or efficiently. and removed answered For when a question was asked and we referred to forum or answered it. 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
Labels
c: Usability For issues that let users achieve a defined goal more effectively or efficiently.
Projects
None yet
Development

No branches or pull requests

8 participants