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

Call to a member function getSubtableDimension() on null in core/DataTable/Filter/PivotByDimension.php #17775

Closed
tsteur opened this issue Jul 15, 2021 · 1 comment · Fixed by #17778
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@tsteur
Copy link
Member

tsteur commented Jul 15, 2021

Error: {"message":"Call to a member function getSubtableDimension() on null","file":"/core/DataTable/Filter/PivotByDimension.php","line":354,"request_id":"d24dc","backtrace":" on /core/DataTable/Filter/PivotByDimension.php(354)\n#0 /core/DataTable/Filter/PivotByDimension.php(169): Piwik\DataTable\Filter\PivotByDimension->setThisReportMetadata(NULL)\n#1 [internal function]: Piwik\DataTable\Filter\PivotByDimension->__construct(Object(Piwik\DataTable\Simple), NULL, 'Referrers.Keywo...', '', 0, 0)\n#2 /core/DataTable.php(524): ReflectionClass->newInstanceArgs(Array)\n#3 /core/DataTable/Map.php(110): Piwik\DataTable->filter('Piwik\\DataTable...', Array)\n#4 /core/API/DataTablePostProcessor.php(163): Piwik\DataTable\Map->filter('PivotByDimensio...', Array)\n#5 /core/API/DataTablePostProcessor.php(113): Piwik\API\DataTablePostProcessor->applyPivotByFilter(Object(Piwik\DataTable\Map))\n#6 /core/API/ResponseBuilder.php(190): Piwik\API\DataTablePostProcessor->process(Object(Piwik\DataTable\Map))\n#7 /core/API/ResponseBuilder.php(104): Piwik\API\ResponseBuilder->handleDataTable(Object(Piwik\DataTable\Map))\n#8 /core/API/Request.php(272): Piwik\API\ResponseBuilder->getResponse(Object(Piwik\DataTable\Map), 'VisitsSummary', 'getVisits')\n#9 /core/Context.php(28): Piwik\API\Request->Piwik\API\{closure}()\n#10 /core/API/Request.php(273): Piwik\Context::executeWithQueryParameters(Array, Object(Closure))\n#11 /plugins/API/Controller.php(46): Piwik\API\Request->process()\n#12 [internal function]: Piwik\Plugins\API\Controller->index()\n#13 /core/FrontController.php(615): call_user_func_array(Array, Array)\n#14 /core/FrontController.php(167): Piwik\FrontController->doDispatch('API', false, Array)\n#15 /core/dispatch.php(32): Piwik\FrontController->dispatch()\n#16 /index.php(25): require_once('/c...')\n#17 {main}","safemode_backtrace":"#0 [internal function]: Piwik\Plugins\Cloud\Controller->safemode(Array)\n#1 /core/FrontController.php(615): call_user_func_array(Array, Array)\n#2 /core/FrontController.php(167): Piwik\FrontController->doDispatch('Cloud', 'safemode', Array)\n#3 /core/FrontController.php(98): Piwik\FrontController->dispatch('CorePluginsAdmi...', 'safemode', Array)\n#4 /core/FrontController.php(138): Piwik\FrontController::(Array)\n#5 /core/FrontController.php(188): Piwik\FrontController::(Object(Error))\n#6 /core/dispatch.php(32): Piwik\FrontController->dispatch()\n#7 /index.php(25): require_once('/c...')\n#8 {main}"}

URL: ?token_auth=XYZANONYMIZED&module=API&method=VisitsSummary.getVisits&idSite=1&period=day&date=last14&segment=&pivotBy=Referrers.Keyword&format=json&flat=0&filter_limit=-1

No referrer found (so probably called directly)

I will comment if it happens again.

@tsteur tsteur added the Bug For errors / faults / flaws / inconsistencies etc. label Jul 15, 2021
@tsteur tsteur added this to the Backlog (Help wanted) milestone Jul 15, 2021
@sgiehl
Copy link
Member

sgiehl commented Jul 16, 2021

@tsteur this is quite easy to fix. The problem is that the pivotBy filter requires a Report class in order to determine the dimension. Will provide a simple PR to throw a exception in that case.

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

Successfully merging a pull request may close this issue.

3 participants