t3n / neos-debug

Adds a debug panel to your Neos CMS website
MIT License
30 stars 16 forks source link

BUG doesnt work in CLI context #177

Open mhsdesign opened 1 year ago

mhsdesign commented 1 year ago
round(): Argument #1 ($num) must be of type int|float, null given

  Type: TypeError
  File: Data/Temporary/Production/Cache/Code/Flow_Object_Classes/
        t3n_Neos_Debug_Aspect_CollectDebugInformationAspect.php
  Line: 95

but @Sebobo and me looked at the code and couldnt make sense of it why it can ever be null.

Instead we disabled the plugin in production mode ^^

(so this can be closed)

Sebobo commented 1 year ago

No this is not true, my change only affects the rendering of the HTML output. This class is still called as the timing headers are added to the response. Meaning we still have to investigate.

mhsdesign commented 1 year ago

the actual error is actually

Warning: Attempt to read property "executionTime" on null in t3n_Neos_Debug_Aspect_CollectDebugInformationAspect.php line 96

that means that https://github.com/t3n/neos-debug/blob/048365523b2dd57b1b45f3e0a6aeb68c98a92d43/Classes/Aspect/CollectDebugInformationAspect.php#L96 sqlLoggingStack is null.

This happened in our case because the fusion rendering was triggered from CLI and https://github.com/t3n/neos-debug/blob/048365523b2dd57b1b45f3e0a6aeb68c98a92d43/Classes/Aspect/CollectDebugInformationAspect.php#L158 will never be triggered as we are not in a web-request.