Jump to content

Tracy Debugger


adrian

Recommended Posts

37 minutes ago, adrian said:

@blynx - it just occurred to me - I think the problem may also be related to SessionHandlerDB - do you have that module installed? If so, there are two things possibly going on. 

Of course you can also just uninstall the SessionHandlerDB module as well, assuming I am correct that this is the problem :)

 

SessionHandlerDB wasn't installed and I set max_allowed_packet to somewhing pretty high compared to it initial value (32M).

Still the same behaviour - though, (even before I raised the max_allowed_packet) it kinda works now. I just get the blank page when I change a setting. But after reloading it seems to work.

Then I also tested it on a webserver with the latest PW - but unfortunately TracyDebugger didn't work at all there no panel, neither in the frontend nor in the backend :-[ ... uhm ... Fresh processwire and fresh TracyDebugger installation. Will have another try on another server some time later - maybe it's the shitty hoster ...

Thanks for your help!

Link to comment
Share on other sites

3 minutes ago, blynx said:

SessionHandlerDB wasn't installed and I set max_allowed_packet to somewhing pretty high compared to it initial value (32M).

Just to clarify - that setting is only relevant if you are using the SessionHandlerDB module.

I am curious whether an update to the latest version of PW helps - there was an issue that was fixed in 3.0.25 that seems like it is related to issues with Tracy - I can't find the post easily right now, but I definitely think it is worth trying.

Also, what about that Max Nesting Depth setting - did you change that at all?

One final thing to confirm - am I correct in assuming that everything works as expected if those Object options are not enabled? If that's the case then I think we might be hitting some server session limit because they can be quite large, although just a guess at this point.

Link to comment
Share on other sites

1 hour ago, Gazley said:

@adrian

I updated the version to latest and unset all the panels as you suggested, with no difference. I've posted my home.php code below.

I am also using @wanze's TemplateEngineTwig module.


<?php

namespace ProcessWire;

// FileCompiler=0

// Line below added to test Tracy issue
$session->redirect('http://localhost:8888/contact/thank-you/');

$forms->addHookAfter('FormBuilderProcessor::saveForm', function(HookEvent $event) {

    $form = $event->object;

    if ($form->formName === 'contact') {

        $session = wire('session');

        if ($packageValue = wire('input')->post['package']) {

            $formMessage = $packageValue;
            $session->set('form-message', $formMessage);

        }

        $rootUrl = SITE_URL;
        $successMessage = $form->successMessage;
        $utils = wire('modules')->get('Utils');
        $session->redirect($utils->stripDoubleSlashes("$rootUrl$successMessage"));

    }

});

$config->forms += ['form' => $forms->render('contact')];

foreach ($page->page_matrix as $item) {

    $view->set($item->output_variable, $item->render());

}

 

 

Thanks - I am not seeing anything there that I think would be relevant, although I have never used TemplateEngineTwig.

Would you mind testing Tracy on the same server without TemplateEngineTwig? Also perhaps try adding a redirect to a template on a fresh PW install - maybe there is some interaction with another module going on.

Did you try switching to the other version of the Tracy core like I suggested - not sure which one you are one, but it might help to narrow things down.

Link to comment
Share on other sites

3 hours ago, blynx said:

Then I also tested it on a webserver with the latest PW - but unfortunately TracyDebugger didn't work at all there no panel, neither in the frontend nor in the backend

Just occurred to me - this one is pretty obvious - by default Tracy is installed in "DETECT" mode which on the live publicly accessible server will automatically be detected as PRODUCTION mode which doesn't show the debug bar (unless you have the "Superuser Force Development Mode" setting checked. Tracy in production mode allows for logging and emailing of errors so it's still a useful tool, but a very different beast.

I have actually been considering getting rid of the DETECT mode option - I think it is probably more confusing than anything - does anyone have any strong thoughts on this?

Link to comment
Share on other sites

On 2016. július 28. at 8:37 PM, tpr said:

Not so strong, but how about renaming to "LOCAL (DETECT)", or something more obvious?

I like "DETECT" the way it is :) 

Maybe you just need to be more precise: "The DETECT option automatically switches from DEVELOPMENT to PRODUCTION mode (or vice versa) based on whether the IP of the site is publicly accessible or not."

Link to comment
Share on other sites

@adrian Hello Adrian,

I have an issue to report, Error: VariablesPanel:

Spoiler

Error: VariablesPanel
exception 'ProcessWire\WireException' with message 'Method LanguagesPageFieldValue::getArray does not exist or is not callable in this context' in /Users/guru/Documents/MAMP/playground/pwmods_loc/wire/core/Wire.php:409
Stack trace:
#0 [internal function]: ProcessWire\Wire->___callUnknown('getArray', Array)
#1 /Users/guru/Documents/MAMP/playground/pwmods_loc/wire/core/Wire.php(347): call_user_func_array(Array, Array)
#2 /Users/guru/Documents/MAMP/playground/pwmods_loc/wire/core/WireHooks.php(548): ProcessWire\Wire->_callMethod('___callUnknown', Array)
#3 /Users/guru/Documents/MAMP/playground/pwmods_loc/wire/core/Wire.php(370): ProcessWire\WireHooks->runHooks(Object(ProcessWire\LanguagesPageFieldValue), 'callUnknown', Array)
#4 /Users/guru/Documents/MAMP/playground/pwmods_loc/wire/core/Wire.php(371): ProcessWire\Wire->__call('callUnknown', Array)
#5 /Users/guru/Documents/MAMP/playground/pwmods_loc/wire/core/Wire.php(371): ProcessWire\LanguagesPageFieldValue->callUnknown('getArray', Array)
#6 /Users/guru/Documents/MAMP/playground/pwmods_loc/site/assets/cache/FileCompiler/site/modules/TracyDebugger/VariablesPanel.inc(90): ProcessWire\Wire->__call('getArray', Array)
#7 /Users/guru/Documents/MAMP/playground/pwmods_loc/site/assets/cache/FileCompiler/site/modules/TracyDebugger/VariablesPanel.inc(90): ProcessWire\LanguagesPageFieldValue->getArray()
#8 [internal function]: VariablesPanel->{closure}(Object(ProcessWire\LanguagesPageFieldValue), 'title')
#9 /Users/guru/Documents/MAMP/playground/pwmods_loc/site/assets/cache/FileCompiler/site/modules/TracyDebugger/VariablesPanel.inc(91): array_walk_recursive(Array, Object(Closure))
#10 /Users/guru/Documents/MAMP/playground/pwmods_loc/site/assets/cache/FileCompiler/site/modules/TracyDebugger/tracy-master/src/Tracy/Bar.php(143): VariablesPanel->getPanel()
#11 /Users/guru/Documents/MAMP/playground/pwmods_loc/site/assets/cache/FileCompiler/site/modules/TracyDebugger/tracy-master/src/Tracy/Bar.php(81): Tracy\Bar->renderPanels()
#12 /Users/guru/Documents/MAMP/playground/pwmods_loc/site/assets/cache/FileCompiler/site/modules/TracyDebugger/tracy-master/src/Tracy/Debugger.php(260): Tracy\Bar->render()
#13 /Users/guru/Documents/MAMP/playground/pwmods_loc/site/assets/cache/FileCompiler/site/modules/TracyDebugger/TracyDebugger.module(584): Tracy\Debugger::shutdownHandler()
#14 /Users/guru/Documents/MAMP/playground/pwmods_loc/wire/core/WireHooks.php(619): TracyDebugger->shutdownTracy(Object(ProcessWire\HookEvent))
#15 /Users/guru/Documents/MAMP/playground/pwmods_loc/wire/core/Wire.php(370): ProcessWire\WireHooks->runHooks(Object(ProcessWire\ProcessWire), 'finished', Array)
#16 /Users/guru/Documents/MAMP/playground/pwmods_loc/wire/core/ProcessWire.php(460): ProcessWire\Wire->__call('finished', Array)
#17 /Users/guru/Documents/MAMP/playground/pwmods_loc/wire/core/ProcessWire.php(365): ProcessWire\ProcessWire->__call('finished', Array)
#18 /Users/guru/Documents/MAMP/playground/pwmods_loc/wire/core/ProcessWire.php(365): ProcessWire\ProcessWire->finished()
#19 /Users/guru/Documents/MAMP/playground/pwmods_loc/wire/modules/Process/ProcessPageView.module(253): ProcessWire\ProcessWire->setStatus(16)
#20 [internal function]: ProcessWire\ProcessPageView->___finished()
#21 /Users/guru/Documents/MAMP/playground/pwmods_loc/wire/core/Wire.php(347): call_user_func_array(Array, Array)
#22 /Users/guru/Documents/MAMP/playground/pwmods_loc/wire/core/WireHooks.php(548): ProcessWire\Wire->_callMethod('___finished', Array)
#23 /Users/guru/Documents/MAMP/playground/pwmods_loc/wire/core/Wire.php(370): ProcessWire\WireHooks->runHooks(Object(ProcessWire\ProcessPageView), 'finished', Array)
#24 /Users/guru/Documents/MAMP/playground/pwmods_loc/index.php(56): ProcessWire\Wire->__call('finished', Array)
#25 /Users/guru/Documents/MAMP/playground/pwmods_loc/index.php(56): ProcessWire\ProcessPageView->finished()
#26 {main}

This is my setup:

  • Ghost Blog Clone by clsource: 
  • ProcessWire 3.0.28 and Tracy Debugger 2.5.4 so everything is the latest.

In order to get the list of variables defined in the template file, I tried to turn on the compiler for the home template, based on this info: https://processwire.com/blog/posts/introducing-tracy-debugger/#non-processwire-template-variables-panel

Home template: first I chose "Yes (template file and files included from it)". The result is what you can see in the spoiler.

Next, I chose "Yes (template file only)" and in this case the result is even "worse", Fatal Error - undefined function wireRenderFile():

Spoiler

Fatal Error

Call to undefined function wireRenderFile() search►

Source file

File: .../playground/pwclone_loc/site/templates/_main.php:15

 etc....

So this is a multilanguage setup, upon which I will probably build my future ProcessWire projects, so it will be nice to sort these out if possible.

Maybe I'm missing something? Thanks in advance.

Edited by szabesz
typo
  • Like 1
Link to comment
Share on other sites

Just for the sake of completeness; the Fatal Error is not related to Tracy, so I even get it with the option No (disabled compiler) too.

Edit: one of the template files was missing "namespace Processwire;" so that is why wireRenderFile() was not found.

Edited by szabesz
added "Edit"
  • Like 1
Link to comment
Share on other sites

On 7/31/2016 at 0:19 AM, szabesz said:

I have an issue to report, Error: VariablesPanel:

Thanks for the report - that was introduced only a couple of versions ago. I think it should be fixed in the latest version - please test and let me know.

  • Like 2
Link to comment
Share on other sites

Thanks for fixing it! 

BTW, I have noticed that in this new version the whole Variables panel disappears when there is nothing to show. It is even gone from the Panel Selector in that case. Isn't this behavior misleading? After all, those who have not read this: "This panel only works with PW 3.x and with templates that use the file compiler." might never realize why this panels does not show up even when it is added in the Settings.

In the previous version it appeared without the variables of course, which was also a bit of a mysterious behavior, because of the missing info on why there were no variables listed.

Link to comment
Share on other sites

21 hours ago, szabesz said:

Thanks for fixing it! 

BTW, I have noticed that in this new version the whole Variables panel disappears when there is nothing to show. It is even gone from the Panel Selector in that case. Isn't this behavior misleading? After all, those who have not read this: "This panel only works with PW 3.x and with templates that use the file compiler." might never realize why this panels does not show up even when it is added in the Settings.

In the previous version it appeared without the variables of course, which was also a bit of a mysterious behavior, because of the missing info on why there were no variables listed.

Thanks for mentioning those issues with the Variables panel. The latest version deals with this in a better manner - let me know your thoughts on the new behavior.

Some other changes in this/recent versions.

  • You can now use bd() in the Console Panel
  • You can now trigger the Mail, Page Recorder, and Event Interceptor panels from the Console Panel - really nice for testing your mailing / page creation code from the console
  • The PW and Tracy log panels are now included in the AJAX debug bar
  • Like 1
Link to comment
Share on other sites

2 hours ago, adrian said:

Thanks for mentioning those issues with the Variables panel. The latest version deals with this in a better manner - let me know your thoughts on the new behavior.

Some other changes in this/recent versions.

  • You can now use bd() in the Console Panel

Thanks, we have the same behavior as before, with an added hint on what is going on.

I also tried bd() in the Console Panel, but I can only get API variables, not template file variables. Am I missing something? Should't it work with variables defined in the template file?

BTW: in various places of the module and its docs you refer to "template file" as "template". It is quite possible to decipher what you mean in the given context, however it can be confusing, particularly to beginners. I know it is quite natural to shorten the term "template file". We have to live with it, but still...

Link to comment
Share on other sites

26 minutes ago, szabesz said:

Thanks, we have the same behavior as before, with an added hint on what is going on.

Sorry I think I must not be understanding the scenario you are seeing - any chance on sending through a screenshot or two highlighting what you are seeing and how you think it should be different.

 

27 minutes ago, szabesz said:

I also tried bd() in the Console Panel, but I can only get API variables, not template file variables. Am I missing something? Should't it work with variables defined in the template file?

Unfortunately I haven't been able to figure out how to make template file variables available in the Console panel - I have tried a couple of times without success, but it is definitely on my list to revisit because it is definitely a significant limitation at the moment. I can get them (like I do in the Variables panel), but can't persist them, but it's still on my list of things to do, so I will be taking another look at it.

 

30 minutes ago, szabesz said:

BTW: in various places of the module and its docs you refer to "template file" as "template". It is quite possible to decipher what you mean in the given context, however it can be confusing, particularly to beginners.

Thanks - I don't suppose you'd be willing to make a list of those places where it's incorrect for me? 

  • Like 1
Link to comment
Share on other sites

3 minutes ago, adrian said:

Sorry I think I must not be understanding the scenario you are seeing - any chance on sending through a screenshot or two highlighting what you are seeing and how you think it should be different.

Well, I did not explain it properly by saying "same behavior as before". Before what? :P Sorry for this! What I meant was that it is back to normal, it works as it used to work in previous versions before you had "made it disappear"... I do get "Template compiling is disabled, so the variables could not be determined." in the panel.

8 minutes ago, adrian said:

Thanks - I don't suppose you'd be willing to make a list of those places where it's incorrect for me? 

Huh :) Isn't it faster if you do a search on the page(s) in the browser? You get all the words "template" highlighted and can just fix them. There aren't too many ;)

  • Like 1
Link to comment
Share on other sites

8 hours ago, bernhard said:

hi @adrian are you still working on the whitescreen issue?

i'm having this issue on an ubuntu 14.04 digitalocean droplet

pw 3.0.28 and tracy 2.5.6

ps: i could give you ssh access if you want? just pm me

Thanks @bernhard for the access to that testing server - very helpful!

@blynx and @Gazley - does the latest version solve your problems? If it doesn't, chances are that you have SessionHandlerDB installed. You can either uninstall it, or edit your php.ini file and if output_buffering is set to 0, please change it to 4096.

I am hoping to get a fix from the core Tracy developers so that neither of these changes are needed, but for the moment I think it should solve things.

 

  • Like 1
Link to comment
Share on other sites

A minor enhancement to the PW Info panel - it now shows the content of UrlSegments. This is what you see for this URL: http://pw3.dev/cms/processwire/?rated=one&star=five

It's only the UrlSegments in the Summary section of the PW Info panel that is new, but I wanted to also point out that in the Tempate Info section is lets you know if URL Segments are enabled for the template. Also, you'll see that the URL has a couple of additional GET parameters - these are listed in the Debug mode panel - they possibly belong better in the PW Info Panel, but the debug mode tools in the PW admin list them here so I kept them this way for consistency. Note that POST variables are also shown if they are present - this can be very handy when debugging form submissions.

Screen-Shot-2016-08-04-at-3.37.21-PM.png

  • Like 2
Link to comment
Share on other sites

I just added a new Metadata section to the Mail panel, as well as linking the attachments so you can easily check them. Note that the Metadata section has currently only been tested with @horst's WireMailSmtp module. Please let me know if you have any problems/requests for use with wireMail's default use of PHP's mail() function, or @teppo's SwiftMailer module.

Screen Shot 2016-08-07 at 2.28.35 PM.png

  • Like 5
Link to comment
Share on other sites

6 hours ago, bernhard said:

Feature request: An auto-update feature for TracyDebugger! Just kidding ;)

Yeah, sorry about the frequency of updates :)

But in all seriousness you might want to take a look at: https://github.com/adrianbj/ProcessModuleToolkit

It's not officially released because there are some outstanding issues I haven't managed to get back to, but one thing it does (it has lots of features), is that it adds a "Batch Upgrade Modules" button to Ryan's Upgrades module. This makes upgrading multiple modules super quick with one click. It also makes installing modules with your preferred config settings really easy. Lots of great options. I guess I really need some more interest from you guys to get the motivation to finish it off.

  • Like 2
Link to comment
Share on other sites

@adrian

I may found two bugs for the Mail panel:

  • it doesn't intercept emails for the backend. I have to add the Mail panel for the Frontend to make it work. If you need I can give you access to a pw setup that sends emails from the admin.
  • "Clear emails" button loads this page when clicked: "/page/edit/bookmarks/"
  • Like 1
Link to comment
Share on other sites

@adrian Non-ProcessWire Template Variables panel question: we have a column labelled "Returns" with object, array, string, etc... in it. However, is it just me who is missing the result of a get_class()call? It would be much more informative to see which class the object is the instance of. Is it possible to implement?

  • Like 1
Link to comment
Share on other sites

19 hours ago, szabesz said:

@adrian Non-ProcessWire Template Variables panel question: we have a column labelled "Returns" with object, array, string, etc... in it. However, is it just me who is missing the result of a get_class()call? It would be much more informative to see which class the object is the instance of. Is it possible to implement?

Done!

 

On 8/15/2016 at 2:16 AM, tpr said:

@adrian

I may found two bugs for the Mail panel:

  • it doesn't intercept emails for the backend. I have to add the Mail panel for the Frontend to make it work. If you need I can give you access to a pw setup that sends emails from the admin.
  • "Clear emails" button loads this page when clicked: "/page/edit/bookmarks/"

Access to that PW install would be helpful - thanks!

  • Like 2
Link to comment
Share on other sites

quick question because i needed it today and couldn't find it: is it possible to see the current url segments somewhere? i just found "urlsegments ON/OFF" indication but it would also be helpful so see wich urlsegments are currently active.

thanks

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...