-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
debug toolbar renderTimeline couses a non well formed numeric value encountered error #2034
Comments
renderTimeline find on system/Debug/Toolbar.php; $offset = ((((float) $row['start'] - (float) $startTime) * 1000) / (float) $displayTime) * 100; |
I've been running into this issue frequently the last week or so. I think there's a bigger underlying issue, perhaps where a timer isn't started? Has anyone solved this? |
How frequently does this happen? |
I haven't had a chance to dig into it - I have a hunch that in my case it was related to failed sessions due to interlocking, but I will try to recreate and test the workarounds. |
I am inclined to apply oe of the workarounds and call it a day on this issue. |
Not a bad idea, but I'm not sure we have enough information yet.
Those two workarounds have drastically different implications, suggesting that the "non well formed numeric value" in a time format in the former and some kind of un-castable float in the latter. A first step might be type-hinting
Tracing back a couple of the collectors, it looks like the intent is for |
Adding a type hint for $startTime dpesn't break anything. Not sure it resolves the issue. |
Describe the bug
Debug toolbar gives error when non well formed numeric value passed to renderTimeline
$offset = ((($row['start'] - $startTime) * 1000) / $displayTime) * 100;
workaround
use strtotime() or round() to $row['start']
CRITICAL - 2019-06-02 06:19:58 --> A non well formed numeric value encountered #0 C:\50.personal\01.cagon\dev10-cms\core\Debug\Toolbar.php(238): CodeIgniter\Debug\Exceptions->errorHandler(8, 'A non well form...', 'C:\\50.personal\\...', 238, Array) #1 C:\50.personal\01.cagon\dev10-cms\core\Debug\Toolbar\Views\toolbar.tpl.php(126): CodeIgniter\Debug\Toolbar->renderTimeline(Array, 1559445597.5886, 7, 40, Array) #2 C:\50.personal\01.cagon\dev10-cms\core\Debug\Toolbar.php(486): include('C:\\50.personal\\...') #3 C:\50.personal\01.cagon\dev10-cms\core\Debug\Toolbar.php(444): CodeIgniter\Debug\Toolbar->format(Array, 'html') #4 C:\50.personal\01.cagon\dev10-cms\app\Config\Events.php(39): CodeIgniter\Debug\Toolbar->respond() #5 [internal function]: CodeIgniter\Events\Events::Config\{closure}() #6 C:\50.personal\01.cagon\dev10-cms\core\Events\Events.php(187): call_user_func(Object(Closure)) #7 C:\50.personal\01.cagon\dev10-cms\core\CodeIgniter.php(226): CodeIgniter\Events\Events::trigger('pre_system') #8 C:\50.personal\01.cagon\dev10-cms\public\index.php(60): CodeIgniter\CodeIgniter->run() #9 C:\50.personal\01.cagon\dev10-cms\rewrite.php(37): require_once('C:\\50.personal\\...') #10 {main}
CodeIgniter 4 version
CodeIgniter 4.0.0-beta.3
Affected module(s)
Debug Toolbar
Expected behavior, and steps to reproduce if appropriate
Must be show the toolbar in the right corner
Context
The text was updated successfully, but these errors were encountered: