Jump to content

Tracy Debugger


adrian

Recommended Posts

@Ipa and @tpr - can you please try the latest version and see if that error is now gone?

Speaking of the latest version, it includes a few new features.

  1. The ability to force superusers to always be in DEVELOPMENT mode, even on a live site.
     
  2. The ability to restrict non-superusers by their IP address - this is very useful if you need to debug a live site for a guest (or non-superuser role) and want the debugger bar and other features normally restricted to development mode. You can set the mode to DEVELOPMENT, give the user the "tracey-debugger" permission, and then restrict to your current IP address.
     
  3. The Users panel provides details of IP Address restriction so you can always easily check if you're safe.

post-985-0-67599400-1456168043_thumb.png

  • Like 1
Link to comment
Share on other sites

i just installed tracy and had some problems:

im on 2.7.2 and installation went without problems. but i can't see the debug bar. neither on frontend nor on backend. i tried with a different browser because i have some problems with visibility sometimes on my laptop and got the following error on the pw-login screen:

debug->true

Fatal error: Cannot use object of type TracyDebugger as array in /var/www/.../site/modules/TracyDebugger/TracyDebugger.module on line 476

Error: Cannot use object of type TracyDebugger as array (line 476 of /var/www/.../site/modules/TracyDebugger/TracyDebugger.module)

This error message was shown because site is in debug mode ($config->debug = true; in /site/config.php). Error has been logged. 

debug->false

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Error has been logged. 

besides those errors: do i have to do some additional things to see the tracy bar?

thanks for your help :)

Link to comment
Share on other sites

The original problem has not gone. At the moment all the frontend pages give me the error: "Class 'ProcessWire\TracyDebugger' not found". I have even tried to reinstall the module, but it doesn't help. I don't see the version mismatch on the upgrades page anymore. 

<?php 57: if(class_exists('TracyDebugger')) {

58: \ProcessWire\wire('templateVars', TracyDebugger::templateVars(get_defined_vars(), \ProcessWire\wire('page')));

59: }

Link to comment
Share on other sites

@BernhardB - are you using the latest version? Also, what version of PHP are you using - I wonder if there might be something connected with that?

@Ipa - can you please try emptying the site/assets/cache/FileCompiler/site/templates folder and see if it starts working after that?

Link to comment
Share on other sites

hi adrian,

PHP Version 5.4.45 and tracy 0.5.4

the error came when i tried to reach the admin in a different browser where i was NOT logged in. in the browser where i installed tracy it seemed that everything worked but i could not see the debug panel. don't know if that's somehow related so my laptop or if i did not setup it correctly? i checked both checkboxes (frontend + backend)

Link to comment
Share on other sites

@Ipa - can you please try emptying the site/assets/cache/FileCompiler/site/templates folder and see if it starts working after that?

The problem is with Show Variables Panel setting. After clearing the compiled files from cache with the Show Variables Panel setting off, everything works. But when I enable the Show Variables Panel, the error is back. 

Link to comment
Share on other sites

The problem is with Show Variables Panel setting. After clearing the compiled files from cache with the Show Variables Panel setting off, everything works. But when I enable the Show Variables Panel, the error is back. 

Yeah, it is that feature which is responsible for adding that line to the bottom of the compiled templates - I just don't yet know why you are still getting the error and @tpr isn't and I have never seen it :) What version of PW and PHP are you running?

great adrian, that did it  :) and i can also see the panel now, it was related to my browser.

Glad it's working now - thanks for letting me know. What do you mean about it being related to your browser?

Link to comment
Share on other sites

@adrian: I just pop in to report that Tracy Debugger 0.5.5 on ProcessWire 3.0.8 with PHP 5.6.10 works without a hitch so far :) Thanx once more!

Awesome - thanks for letting me know.

I did just make another change though in an attempt to fix the problem @Ipa is still having with the Variables panel. Hopefully this might work and hopefully I haven't broken anything for anyone else :)

  • Like 1
Link to comment
Share on other sites

Awesome - thanks for letting me know.

I did just make another change though in an attempt to fix the problem @Ipa is still having with the Variables panel. Hopefully this might work and hopefully I haven't broken anything for anyone else :)

Sorry, but it still doesn't work for me. I have PHP 5.5.29, PW 3.0.8 and Mac OS X 10.10.5.

Link to comment
Share on other sites

I switched to PHP 5.5.26 (that is the closest to 5.5.29 I happen have at the moment). I am also on OS X 10.10.5 but this should not matter too much I guess. I also updated to 0.5.6. Actually I have just realized, that although I do not get any errors with $Variables Panel turned on, it does not display any variables except for a strange empty array, like this:

array ()

That is all I have in the panel, however – for example – I have $title = $page->get('headline|title'); in my _init.php and <?= $title ?> outputs fine. Shouldn't it be a variable that is displayed in this panel?

Link to comment
Share on other sites

@Ipa - did you clear your FileCompiler templates cache after installing the new version? - this is essential to ensure the new version of the code is added into the templates when they are compiled.

I switched to PHP 5.5.26 (that is the closest to 5.5.29 I happen have at the moment). I am also on OS X 10.10.5 but this should not matter too much I guess. I also updated to 0.5.6. Actually I have just realized, that although I do not get any errors with $Variables Panel turned on, it does not display any variables except for a strange empty array, like this:

array ()

That is all I have in the panel, however – for example – I have $title = $page->get('headline|title'); in my _init.php and <?= $title ?> outputs fine. Shouldn't it be a variable that is displayed in this panel?

Sorry, I should have made it more obvious that for this feature to work, you need to clear your compiled templates cache as it needs to add a line to the bottom of the compiled template. Once you do this once, it will work for future updates to your templates.

Link to comment
Share on other sites

Thanks. I manually cleaned .../site/assets/cache/FileCompiler/site/modules and got fatal error as the class TracyDebugger was not found. (Class 'ProcessWire\TracyDebugger' not found). And using Admin > Modules > Site > [Clear Compiled Files] button afterwards did not help.

Deleting the FileCompiler folder itself gets rid of the error, but my original problem (that is not seeing any variables in the panel) remained.

One more thing. If I manually delete .../site/assets/cache/FileCompiler/site/modules and do not resave the module settings afterwards but try to reload the forntend, then the Fatal Error is back againg.

Link to comment
Share on other sites

So the line added to the end of my compiled template files currently looks like:

if(class_exists('TracyDebugger')) {
    TracyDebugger::$templateVars = TracyDebugger::templateVars(get_defined_vars(), \ProcessWire\wire('page'));
}

Does that match what you are currently seeing?

What if you manually add \ProcessWire\ in front of each TracyDebugerr, like this - just do it for one of the compiled template files and load a page with that template - this is just a test for me at the moment to help debug.

if(class_exists('\ProcessWire\TracyDebugger')) {
    \ProcessWire\TracyDebugger::$templateVars = \ProcessWire\TracyDebugger::templateVars(get_defined_vars(), \ProcessWire\wire('page'));
}

I feel like I am going off on a tangent here, but what happens if you also add false to that check, eg:

if(class_exists('\ProcessWire\TracyDebugger', false)) {
    \ProcessWire\TracyDebugger::$templateVars = \ProcessWire\TracyDebugger::templateVars(get_defined_vars(), \ProcessWire\wire('page'));
}
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...