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

Bug fix for avoiding errors when build the customized menu #3649

Closed
anonymous-matomo-user opened this issue Jan 3, 2013 · 3 comments
Closed
Labels
Bug For errors / faults / flaws / inconsistencies etc. worksforme The issue cannot be reproduced and things work as intended.
Milestone

Comments

@anonymous-matomo-user
Copy link

If I build a customized sub-menus, for example a custom menu for superuser. The error will be shown if follow the steps below:

  1. Go to "Users", click on "Websites", change it to "Apply to all websites" (idSite=all)
  2. Go to the page which contains the customized menu

The error will be:


The parameter 'idSite' doesn't have a correct type, and a default value wasn't provided.

Go to Piwik
Login

Backtrace:

#0 D:\Web\PHP\Piwik\plugins\Goals\Goals.php(475): Piwik_Common::getRequestVar('idSite', NULL, 'int')
#1 [internal function]: Piwik_Goals->addMenus(Object(Piwik_Event_Notification))
#2 D:\Web\PHP\Piwik\libs\Event\Dispatcher.php(284): call_user_func_array(Array, Array)
#3 D:\Web\PHP\Piwik\core\PluginsManager.php(722): Event_Dispatcher->postNotification(Object(Piwik_Event_Notification), false, false)
#4 D:\Web\PHP\Piwik\core\Menu\Main.php(65): Piwik_PostEvent('Menu.add')
#5 D:\Web\PHP\Piwik\plugins\CustomNavigation\API.php(71): Piwik_Menu_Main->get()
#6 D:\Web\PHP\Piwik\plugins\CustomSuperusers\Controller.php(30): Piwik_CustomNavigation_API->getMenu('CustomSuperuser...')
#7 D:\Web\PHP\Piwik\plugins\CustomSuperusers\Controller.php(50): Piwik_CustomSuperusers_Controller->getNavigation()
#8 [internal function]: Piwik_CustomSuperusers_Controller->index()
#9 D:\Web\PHP\Piwik\core\FrontController.php(138): call_user_func_array(Array, Array)
#10 D:\Web\PHP\Piwik\index.php(53): Piwik_FrontController->dispatch()
#11 {main}

My workaround is:

in the "/plugins/Goals/Goals.php",
Change

$idSite = Piwik_Common::getRequestVar('idSite', null, 'int');

to

$idSite = 0;

try
{
    $idSite = Piwik_Common::getRequestVar('idSite', null, 'int');
}
catch (Exception $e)
{
    $idSite = Piwik_SitesManager_API::getInstance()->getAllSitesId();
}
@anonymous-matomo-user
Copy link
Author

This is the latest update from my development:

$idSite = 0;
try
{
    $idSite = Piwik_Common::getRequestVar('idSite', null, 'int');
}
catch (Exception $e)
{

}
if(empty($idSite)) return;

@mattab
Copy link
Member

mattab commented Jan 18, 2013

do you still have the problem in 1.10.1 without your patch?

@anonymous-matomo-user
Copy link
Author

Replying to matt:

do you still have the problem in 1.10.1 without your patch?

Will check when I plan for upgrading :), thanks a lot.

@anonymous-matomo-user anonymous-matomo-user added this to the 1.x - Piwik 1.x milestone Jul 8, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. worksforme The issue cannot be reproduced and things work as intended.
Projects
None yet
Development

No branches or pull requests

2 participants