@tsteur opened this Issue on October 17th 2022 Member

Using Matomo 4.12

Link to reproduce: https://demo.matomo.cloud/?module=API&limitBeforeGrouping=all&method=Transitions.getTransitionsForPageUrl&pageUrl=https://divezone.net/&idSite=1&period=day&date=yesterday&format=JSON&token_auth=anonymous

Backtrace:

Error: {"message":"Unsupported operand types: string + int","file":"\/core\/RankingQuery.php","line":288,"request_id":"a73eb","backtrace":" on \/core\/RankingQuery.php(288)\n#0 \/core\/RankingQuery.php(229): Piwik\RankingQuery->generateRankingQuery('SELECT \/ sites...')\n#1 \/core\/DataAccess\/LogAggregator.php(981): Piwik\RankingQuery->execute('SELECT \/ sites...', Array, 300)\n#2 \/plugins\/Transitions\/API.php(459): Piwik\DataAccess\LogAggregator->queryActionsByDimension(Array, 'log_linkvisit...', Array, Array, Object(Piwik\RankingQuery), Array, 'name', 300)\n#3 \/plugins\/Transitions\/API.php(195): Piwik\Plugins\Transitions\API->queryInternalReferrers('144', 'url', Object(Piwik\DataAccess\LogAggregator), 'all')\n#4 \/plugins\/Transitions\/API.php(93): Piwik\Plugins\Transitions\API->addInternalReferrers(Object(Piwik\DataAccess\LogAggregator), Array, '144', 'url', 'all')\n#5 \/plugins\/Transitions\/API.php(46): Piwik\Plugins\Transitions\API->getTransitionsForAction('https:\/\/divezon...', 'url', '1', Object(Piwik\Period\Day), 'yesterday', Object(Piwik\Segment), 'all')\n#6 [internal function]: Piwik\Plugins\Transitions\API->getTransitionsForPageUrl('https:\/\/divezon...', '1', 'day', 'yesterday', false, 'all')\n#7 \/core\/API\/Proxy.php(244): call_user_func_array(Array, Array)\n#8 \/core\/Context.php(28): Piwik\API\Proxy->Piwik\API\{closure}()\n#9 \/core\/API\/Proxy.php(335): Piwik\Context::executeWithQueryParameters(Array, Object(Closure))\n#10 \/core\/API\/Request.php(267): Piwik\API\Proxy->call('\\Piwik\\Plugins\\...', 'getTransitionsF...', Array)\n#11 \/plugins\/API\/Controller.php(45): Piwik\API\Request->process()\n#12 [internal function]: Piwik\Plugins\API\Controller->index()\n#13 \/core\/FrontController.php(631): call_user_func_array(Array, Array)\n#14 \/core\/FrontController.php(169): 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(631): call_user_func_array(Array, Array)\n#2 \/core\/FrontController.php(169): Piwik\FrontController->doDispatch('Cloud', 'safemode', Array)\n#3 \/core\/FrontController.php(100): Piwik\FrontController->dispatch('CorePluginsAdmi...', 'safemode', Array)\n#4 \/core\/FrontController.php(140): Piwik\FrontController::(Array)\n#5 \/core\/FrontController.php(190): Piwik\FrontController::(Object(TypeError))\n#6 \/core\/dispatch.php(32): Piwik\FrontController->dispatch()\n#7 \/index.php(25): require_once('\/c...')\n#8 {main}"}

@peterhashair commented on October 17th 2022 Contributor

I can reproduce this on my local, seems like this line, $this->limit is 'all'

https://github.com/matomo-org/matomo/blob/32bb2f99e59ba410b01832f789bc591cad6acf8c/core/RankingQuery.php#L288

@peterhashair commented on October 18th 2022 Contributor

@tsteur just checking it seems like this is caused by the wrong param limitBeforeGrouping=all, do we want to throw an error on that one? Or do we want to accept the all

@tsteur commented on October 18th 2022 Member

No big preference. Not sure what we're doing in other places if we were to use a wrong value?

I tried https://apache.matomo/index.php?module=API&format=JSON&idSite=1&period=year&date=2022-10-08&method=Live.getLastVisitsDetails&filter_limit=all&expanded=1&token_auth=...&force_api_session=1 and it didn't throw an error and just worked. Not sure how it is implemented there?

This Issue was closed on November 6th 2022
Powered by GitHub Issue Mirror