@mattab opened this issue on August 7th 2014

Url to reproduce: http://demo.piwik.org/index.php?module=API&method=API.getRowEvolution&idSite=7&period=day&date=2014-07-01,2014-07-05&apiModule=VisitsSummary&apiAction=get&legendAppendMetric=1&labelUseAbsoluteUrl=1&format=original&token_auth=anonymous

Error message:

Notice: Undefined index: dimension in /home/piwik-demo/www/demo.piwik.org/plugins/API/RowEvolution.php on line 334

Backtrace -->

#0 Piwik\Error::errorHandler(...) called at [/home/piwik-demo/www/demo.piwik.org/plugins/API/RowEvolution.php:334]
#1 Piwik\Plugins\API\RowEvolution->getRowEvolutionMetaData(...) called at [/home/piwik-demo/www/demo.piwik.org/plugins/API/RowEvolution.php:54]
#2 Piwik\Plugins\API\RowEvolution->getRowEvolution(...) called at [/home/piwik-demo/www/demo.piwik.org/plugins/API/API.php:544]
#3 Piwik\Plugins\API\API->getRowEvolution(...) called at [:]
#4 call_user_func_array(...) called at [/home/piwik-demo/www/demo.piwik.org/core/API/Proxy.php:209]
#5 Piwik\API\Proxy->call(...) called at [/home/piwik-demo/www/demo.piwik.org/core/API/Request.php:215]
#6 Piwik\API\Request->process(...) called at [/home/piwik-demo/www/demo.piwik.org/plugins/API/Controller.php:31]
#7 Piwik\Plugins\API\Controller->index(...) called at [:]
#8 call_user_func_array(...) called at [/home/piwik-demo/www/demo.piwik.org/core/FrontController.php:531]
#9 Piwik\FrontController->doDispatch(...) called at [/home/piwik-demo/www/demo.piwik.org/core/FrontController.php:84]
#10 Piwik\FrontController->dispatch(...) called at [/home/piwik-demo/www/demo.piwik.org/core/dispatch.php:34]
#11 require_once(...) called at [/home/piwik-demo/www/demo.piwik.org/index.php:47]

Expected instead: no notice message.

@tsteur commented on August 8th 2014

I had a quick look but do not really know how to fix it. I didn't simply wanted to add an array_key_exists check and ignore the error as it might have side effects. Dimension seems to be used in quite a few places (UI etc). Maybe it is rather appropriate to throw an exception "Not supported" if a report like "VisitsSummary.get" has no dimension?

@mattab commented on August 9th 2014

@tsteur +1 for throwing exception as if it's not fully supported.

This issue was closed on August 9th 2014
Powered by GitHub Issue Mirror