@mattab opened this Issue on August 7th 2014 Owner

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

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

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 Owner

@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