matomo-org / matomo

Empowering People Ethically with the leading open source alternative to Google Analytics that gives you full control over your data. Matomo lets you easily collect data from websites & apps and visualise this data and extract insights. Privacy is built-in. Liberating Web Analytics. Star us on Github? +1. And we love Pull Requests!
https://matomo.org/
GNU General Public License v3.0
19.83k stars 2.64k forks source link

Call to undefined method Map::getMetadata() in ProcessedReport.php #21125

Open tsteur opened 1 year ago

tsteur commented 1 year ago

We received below error on latest Matomo 4.X

Error: {"message":"Call to undefined method Piwik\DataTable\Map::getMetadata()","file":"plugins\/API\/ProcessedReport.php","line":521,"request_id":"a5e76","backtrace":" on plugins\/API\/ProcessedReport.php(521)\n#0 plugins\/API\/ProcessedReport.php(489): Piwik\Plugins\API\ProcessedReport->removeEmptyColumns(Array, Array, Object(Piwik\DataTable\Map))\n#1 plugins\/API\/ProcessedReport.php(390): Piwik\Plugins\API\ProcessedReport->handleTableReport('1,2', Object(Piwik\DataTable\Map), Array, false, 'bc')\n#2 plugins\/API\/API.php(283): Piwik\Plugins\API\ProcessedReport->getProcessedReport('1,2', 'day', 'last365', 'UserCountry', 'getContinent', false, Array, false, false, '1', false, false, false, 'bc', false)\n#3 [internal function]: Piwik\Plugins\API\API->getProcessedReport('1,2', 'day', 'last365', 'UserCountry', 'getContinent', false, false, false, false, '1', false, false, false, 'bc', false)\n#4 core\/API\/Proxy.php(244): call_user_func_array(Array, Array)\n#5 core\/Context.php(28): Piwik\API\Proxy->Piwik\API\{closure}()\n#6 core\/API\/Proxy.php(335): Piwik\Context::executeWithQueryParameters(Array, Object(Closure))\n#7 core\/API\/Request.php(267): Piwik\API\Proxy->call('\\Piwik\\Plugins\\...', 'getProcessedRep...', Array)\n#8 plugins\/API\/Controller.php(45): Piwik\API\Request->process()\n#9 [internal function]: Piwik\Plugins\API\Controller->index()\n#10 core\/FrontController.php(637): call_user_func_array(Array, Array)\n#11 core\/FrontController.php(169): Piwik\FrontController->doDispatch('API', false, Array)\n#12 core\/dispatch.php(32): Piwik\FrontController->dispatch()\n#13 index.php(25): require_once('c...')\n#14 {main}","safemode_backtrace":"#0 [internal function]:

URL: /?token_auth=XYZANONYMIZED&module=API&method=API.getProcessedReport&showTimer=1&format=JSON&idSite=1,2&period=day&date=last365&apiModule=UserCountry&apiAction=getContinent

Referrer: None

GET: {"token_auth":"XYZANONYMIZED","module":"API","method":"API.getProcessedReport","showTimer":"1","format":"JSON","idSite":"1,2","period":"day","date":"last365","apiModule":"UserCountry","apiAction":"getContinent","filter_limit":100}

sgiehl commented 1 year ago

@tsteur Guess that happens as multiple id sites and dates are provided. Looking at the code API.getProcessedReport is only able to handle multiple dates. So guess we need to decide if we want to add support for multiple id sites or throw an "unsupported" message instead.

tsteur commented 1 year ago

@sgiehl I believe we wanted to remove that support eventually more and more and have maybe already done partially. I couldn't find the related issue/PRs though. I believe that's for example because certain reports don't work over multiple sites that well when they include forms, goals, custom dimensions, segments, etc. Not sure if I remember that correctly though.