@anonymous-matomo-user opened this Issue on January 3rd 2013

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:

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

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 commented on January 18th 2013 Member

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

@anonymous-matomo-user commented on February 5th 2013

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.

This Issue was closed on March 11th 2013
Powered by GitHub Issue Mirror