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

Notice: Undefined index: dimension in plugins/API/RowEvolution.php on line 334 #5951

Closed
mattab opened this issue Aug 7, 2014 · 2 comments
Closed
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@mattab
Copy link
Member

mattab commented Aug 7, 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.

@mattab mattab added this to the Piwik 2.5.0 milestone Aug 7, 2014
@mattab mattab added the Bug label Aug 7, 2014
@tsteur
Copy link
Member

tsteur commented Aug 8, 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
Copy link
Member Author

mattab commented Aug 9, 2014

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

@tsteur tsteur closed this as completed in 3b962d9 Aug 9, 2014
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.
Projects
None yet
Development

No branches or pull requests

2 participants