Jump to content

Tracy Debugger


adrian

Recommended Posts

19 hours ago, LAPS said:

@adrian I'll test in the next few days (I hope) 

The other thing you can do is check for a Tracey Bluescreen exception html file in /site/assets/logs/tracy/ - hopefully that exception would have been logged there and it will show the full stack trace.

Link to comment
Share on other sites

since updating to the latest version (v4.21.34) Iam getting this error on my frontend, when tracy is enabled (localhost environment):

TypeError: strpos() expects parameter 1 to be string, boolean given in /Users/janploch/sites/michael-bader/dist/site/modules/TracyDebugger/tracy-2.8.x/src/Tracy/Bar/assets/loader.phtml:17 Stack trace: #0 /Users/janploch/sites/michael-bader/dist/site/modules/TracyDebugger/tracy-2.8.x/src/Tracy/Bar/assets/loader.phtml(17): strpos(false, '?') #1 /Users/janploch/sites/michael-bader/dist/site/assets/cache/FileCompiler/site/modules/TracyDebugger/tracy-2.8.x/src/Tracy/Bar/Bar.php(114): require('/Users/janploch...') #2 /Users/janploch/sites/michael-bader/dist/site/assets/cache/FileCompiler/site/modules/TracyDebugger/tracy-2.8.x/src/Tracy/Debugger/Debugger.php(299): Tracy\Bar->render() #3 [internal function]: Tracy\Debugger::shutdownHandler() #4 {main} (stored in /Users/janploch/sites/michael-bader/dist/site/assets/logs/tracy/exception--2020-12-16--16-24--7e3166bc41.html)

 

Link to comment
Share on other sites

Hi @jploch - not sure why, but as you can see, /TracyDebugger/tracy-2.8.x/src/Tracy/Bar/assets/loader.phtml has this code:

strpos(false, '?')

but the line in that file (https://github.com/adrianbj/TracyDebugger/blob/637e9cf6b9e3d37037fa282d65e34940fc539e97/tracy-2.8.x/src/Tracy/Bar/assets/loader.phtml#L17) is:

$baseUrl .= strpos($baseUrl, '?') === false ? '?' : '&';

Would please mind taking a look and seeing what exactly you have there. If $baseUrl is false, perhaps there is an issue with the 
 

$baseUrl = $_SERVER['REQUEST_URI'] ?? '';

line above returning false, instead of an empty string. 

What is your local dev setup and versions of things?

I don't really understand why updating to the latest version of Tracy would change anything, because that bit of code has been like that for a while.

Link to comment
Share on other sites

  • 3 weeks later...

@adrian Hi Adrian, tiny bug report, I get some PHP notices in the errors panel when I define a constant with an array value in my config.php:

2x PHP Notice: Array to string conversion in .../includes/GetTemplateResources.php:6

This is the corresponding line:

\TracyDebugger::$templateConsts = array_diff_assoc(get_defined_constants(), \TracyDebugger::$initialConsts);

I found this question on SO, apparently array_diff_assoc always throws this warning when given a multidimensional array, and get_defined_constants will be multidimensional if one of the constants is an array. Not sure how to properly fix this, maybe run through the defined constants and handle all constants with array values separately? It's not that big a deal, but the red error notice on the bottom is bugging me ^^

Here's an example of constants in my config.php that causes this error (slightly obfuscated):

const MEMBER_TYPE_X = 123;
const MEMBER_TYPE_Y = 456;
const MEMBER_TYPE_Z = 789;

const MEMBER_ACCESS_FIELDS = [
    MEMBER_TYPE_X => 'access_x',
    MEMBER_TYPE_Y => 'access_y',
    MEMBER_TYPE_Z => 'access_z',
];

Can you take a look? Thanks!

  • Like 1
Link to comment
Share on other sites

We've finally created the first dedicated forum for a module so I'm locking and pinning this topic for reference. If you need to ask questions/give feedback, please start a new topic in this forum.

Thanks!

  • Like 5
Link to comment
Share on other sites

  • adrian pinned and locked this topic
  • adrian unpinned and pinned this topic
Guest
This topic is now closed to further replies.
×
×
  • Create New...