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

Illegal offset type in isset or empty in Site.php #19221

Closed
JasonMortonNZ opened this issue May 16, 2022 · 1 comment
Closed

Illegal offset type in isset or empty in Site.php #19221

JasonMortonNZ opened this issue May 16, 2022 · 1 comment
Labels
Bug For errors / faults / flaws. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.

Comments

@JasonMortonNZ
Copy link
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#0 \/var\/www\/html\/core\/Site.php(557): Piwik\\Site::getFor(Array, 'type')\n#1 \/var\/www\/html\/core\/Settings\/Measurable\/MeasurableSettings.php(58): Piwik\\Site::getTypeFor(Array)\n#2 \/var\/www\/html\/plugins\/SearchEngineKeywordsPerformance\/API.php(66): Piwik\\Settings\\Measurable\\MeasurableSettings->__construct(Array)\n#3 [internal function]: Piwik\\Plugins\\SearchEngineKeywordsPerformance\\API->getKeywords(Array, 'day', 'yesterday')\n#4 \/var\/www\/html\/core\/API\/Proxy.php(244): call_user_func_array(Array, Array)\n#5 \/var\/www\/html\/core\/Context.php(28): Piwik\\API\\Proxy->Piwik\\API\\{closure}()\n#6 \/var\/www\/html\/core\/API\/Proxy.php(335): Piwik\\Context::executeWithQueryParameters(Array, Object(Closure))\n#7 \/var\/www\/html\/core\/API\/Request.php(266): Piwik\\API\\Proxy->call('\\\\Piwik\\\\Plugins\\\\...', 'getKeywords', Array)\n#8 \/var\/www\/html\/plugins\/API\/Controller.php(45): Piwik\\API\\Request->process()\n#9 [internal function]: Piwik\\Plugins\\API\\Controller->index()\n#10 \/var\/www\/html\/core\/FrontController.php(631): call_user_func_array(Array, Array)\n#11 \/var\/www\/html\/core\/FrontController.php(169): Piwik\\FrontController->doDispatch('API', false, Array)\n#12 \/var\/www\/html\/core\/dispatch.php(32): Piwik\\FrontController->dispatch()\n#13 \/var\/www\/html\/index.php(25): require_once('\/var\/www\/html\/c...')\n#14 {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}"}

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=
@JasonMortonNZ JasonMortonNZ added the Potential Bug Something that might be a bug, but can't be reproduced (yet). label May 16, 2022
@sgiehl
Copy link
Member

sgiehl commented May 16, 2022

Also improper parameter handling. idSite is provided a an array, but we expect a single value only.
See #19222 (comment)

@sgiehl sgiehl added Bug For errors / faults / flaws. and removed Potential Bug Something that might be a bug, but can't be reproduced (yet). labels Nov 9, 2022
@sgiehl sgiehl added this to the For Prioritization milestone Nov 9, 2022
@sgiehl sgiehl added the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

No branches or pull requests

2 participants