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

Fatal error: abs(): Argument #1 ($num) must be of type int|float, string given in Insights/Model.php #20041

Open
tsteur opened this issue Nov 23, 2022 · 1 comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.

Comments

@tsteur
Copy link
Member

tsteur commented Nov 23, 2022

Got below fatal error:

Error: {"message":"abs(): Argument #1 ($num) must be of type int|float, string given","file":"plugins/Insights/Model.php","line":62,"request_id":"2b3e0","backtrace":" on plugins/Insights/Model.php(62)\n#0 plugins/Insights/Model.php(62): abs('"><i...')\n#1 plugins/Insights/API.php(273): Piwik\Plugins\Insights\Model->getLastDate('today', 'day', '"><i...')\n#2 [internal function]: Piwik\Plugins\Insights\API->getInsights('1', 'day', 'today', 'Referrers_getSe...', false, '13', '12', '', '0.1', '1', '"><i...', 'absolute')\n#3 core/API/Proxy.php(244): call_user_func_array(Array, Array)\n#4 core/Context.php(28): Piwik\API\Proxy->Piwik\API\{closure}()\n#5 core/API/Proxy.php(335): Piwik\Context::executeWithQueryParameters(Array, Object(Closure))\n#6 core/Plugin/Visualization.php(341): Piwik\API\Proxy->call('\\Piwik\\Plugins\\...', 'getInsights', Array)\n#7 core/Plugin/Visualization.php(188): Piwik\Plugin\Visualization->loadDataTableFromAPI()\n#8 core/Plugin/Report.php(320): Piwik\Plugin\Visualization->render()\n#9 plugins/CoreHome/Controller.php(60): Piwik\Plugin\Report->render()\n#10 [internal function]: Piwik\Plugins\CoreHome\Controller->renderReportWidget(Object(Piwik\Plugins\Referrers\Reports\GetSearchEngines))\n#11 core/FrontController.php(631): call_user_func_array(Array, Array)\n#12 core/FrontController.php(169): Piwik\FrontController->doDispatch('Referrers', 'getSearchEngine...', Array)\n#13 core/dispatch.php(32): Piwik\FrontController->dispatch()\n#14 index.php(25): require_once('c...')\n#15 {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}"}

URL: index.php?date=today&module=Referrers&format=html&action=getSearchEngines&idSite=1&period=day&segment=&widget=&showtitle=1&random=3319

Referrer: index.php?module=CoreHome&action=index&idSite=1&period=day&date=today

GET: {"date":"today","module":"Referrers","format":"html","action":"getSearchEngines","idSite":"1","period":"day","segment":"","widget":"","showtitle":"1","random":"3319"}

@tsteur tsteur added Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. To Triage An issue awaiting triage by a Matomo core team member labels Nov 23, 2022
@bx80
Copy link
Contributor

bx80 commented Nov 23, 2022

From the backtrace it appears that the getInsights() API method was called with the value ><i... passed for the $comparedToXPeriods parameter. Could be a UI bug somewhere with an HTML fragment being passed by a broken link?

@bx80 bx80 added this to the For Prioritization milestone Nov 23, 2022
@bx80 bx80 added Bug For errors / faults / flaws / inconsistencies etc. and removed Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. To Triage An issue awaiting triage by a Matomo core team member labels Nov 23, 2022
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

No branches or pull requests

2 participants