@JasonMortonNZ opened this Issue on May 16th 2022 Contributor

This error has been popping up recently:

Error: {"message":"Illegal offset type in isset or empty","file":"\/var\/www\/html\/core\/Site.php","line":483,"request_id":"6e056","backtrace":" on \/var\/www\/html\/core\/Site.php(483)\n<a href='/0'>#0</a> \/var\/www\/html\/core\/Site.php(557): Piwik\\Site::getFor(Array, 'type')\n<a href='/1'>#1</a> \/var\/www\/html\/core\/Settings\/Measurable\/MeasurableSettings.php(58): Piwik\\Site::getTypeFor(Array)\n<a href='/2'>#2</a> \/var\/www\/html\/plugins\/SearchEngineKeywordsPerformance\/API.php(66): Piwik\\Settings\\Measurable\\MeasurableSettings->__construct(Array)\n<a href='/3'>#3</a> [internal function]: Piwik\\Plugins\\SearchEngineKeywordsPerformance\\API->getKeywords(Array, 'day', 'yesterday')\n<a href='/4'>#4</a> \/var\/www\/html\/core\/API\/Proxy.php(244): call_user_func_array(Array, Array)\n<a href='/5'>#5</a> \/var\/www\/html\/core\/Context.php(28): Piwik\\API\\Proxy->Piwik\\API\\{closure}()\n<a href='/6'>#6</a> \/var\/www\/html\/core\/API\/Proxy.php(335): Piwik\\Context::executeWithQueryParameters(Array, Object(Closure))\n<a href='/7'>#7</a> \/var\/www\/html\/core\/API\/Request.php(266): Piwik\\API\\Proxy->call('\\\\Piwik\\\\Plugins\\\\...', 'getKeywords', Array)\n<a href='/8'>#8</a> \/var\/www\/html\/plugins\/API\/Controller.php(45): Piwik\\API\\Request->process()\n<a href='/9'>#9</a> [internal function]: Piwik\\Plugins\\API\\Controller->index()\n<a href='/10'>#10</a> \/var\/www\/html\/core\/FrontController.php(631): call_user_func_array(Array, Array)\n<a href='/11'>#11</a> \/var\/www\/html\/core\/FrontController.php(169): Piwik\\FrontController->doDispatch('API', false, Array)\n<a href='/12'>#12</a> \/var\/www\/html\/core\/dispatch.php(32): Piwik\\FrontController->dispatch()\n<a href='/13'>#13</a> \/var\/www\/html\/index.php(25): require_once('\/var\/www\/html\/c...')\n<a href='/14'>#14</a> {main}","safemode_backtrace":"<a href='/0'>#0</a> [internal function]: Piwik\\Plugins\\Cloud\\Controller->safemode(Array)\n<a href='/1'>#1</a> \/core\/FrontController.php(631): call_user_func_array(Array, Array)\n<a href='/2'>#2</a> \/core\/FrontController.php(169): Piwik\\FrontController->doDispatch('Cloud', 'safemode', Array)\n<a href='/3'>#3</a> \/core\/FrontController.php(100): Piwik\\FrontController->dispatch('CorePluginsAdmi...', 'safemode', Array)\n<a href='/4'>#4</a> \/core\/FrontController.php(140): Piwik\\FrontController::(Array)\n<a href='/5'>#5</a> \/core\/FrontController.php(190): Piwik\\FrontController::(Object(TypeError))\n<a href='/6'>#6</a> \/core\/dispatch.php(32): Piwik\\FrontController->dispatch()\n<a href='/7'>#7</a> \/index.php(25): require_once('\/c...')\n<a href='/8'>#8</a> {main}"}

Steps to Reproduce (for Bugs)

URL: https://matomo.test/index.php?date=yesterday&format=JSON&idSite[]=1&method=SearchEngineKeywordsPerformance.getKeywords&module=API&period=day&token_auth=XYZANONYMIZED

Referrer: https://matomo.test/

GET: {"date":"yesterday","format":"JSON","idSite":["1"],"method":"SearchEngineKeywordsPerformance.getKeywords","module":"API","period":"day","token_auth":"XYZANONYMIZED","filter_limit":100}

Your Environment

  • Matomo Version: 4.9.1
  • PHP Version: 8.0
  • Server Operating System: Linux=
@sgiehl commented on May 16th 2022 Member

Also improper parameter handling. idSite is provided a an array, but we expect a single value only.
See https://github.com/matomo-org/matomo/issues/19222#issuecomment-1127400420

Powered by GitHub Issue Mirror