adrian

Tracy Debugger

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!

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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."

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
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...

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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

  • Like 1

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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

  • Like 1

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By anderson
      Hi all,
      I'm a new to website building. Learned some CRASH course of js,jquery,php. Then I found CMS. Still learning around forum, youtube....
      Anyway, please help me with some beginer questions:
      1, About template - please correct me if I understand wrong : every page should be (or recommended) built on a template. So if in total I'll have 10 pages, 2 of them have same layout, I'll need 9 templates.  And, what fields a page includes, is not defined in page, but defined in the template that page uses. 
      2,  Where to see what modules I've installed? is it in "Modules - Site"? 
      3, I installed "PageTable Extended", then what?  As in a youtube tutorial, it should appear in Setup tab, but it doesn't.  What's in there: templates,fields,logs,comments. (I installed "Uikit 3 site_blog profile".)
      4, I did a search in Processwire website for the famous "repeater matrix" module, and can not find it, there's a Repeater, as well as a Matrix. Is it not a module?
      5, I watched this youtube tuts: https://www.youtube.com/watch?v=IHqnLQy9R1A
      Anybody familiar with this tuts please help: 
      After he analysed a target webpage layout he wanted to mimic, he created some fields, some template, then based on those he created a page and input some "content" in there, then clicked "view", it's just some text. So, here comes my question, he copied a folder "assets" (subfolders are: css,fonts,js,img) over, then the page have the appearance/layout he wanted to mimic. Where does that assets folder come from?
      Appreciate any help.
    • By mtwebit
      I've created a set of modules for importing (manipulating and displaying) data from external resources. A key requirement was to handle large (100k+) number of pages easily.
      Main features
      import data from CSV and XML sources in the background (using Tasker) purge, update or overwrite existing pages using selectors user configurable input <-> field mappings on-the-fly data conversion and composition (e.g. joining CSV columns into a single field) download external resources (files, images) during import handle page references by any (even numeric) fields How it works
      You can upload CSV or XML files to DataSet pages and specify import rules in their description.
      The module imports the content of the file and creates/updates child pages automatically.
      How to use it
      Create a DataSet page that stores the source file. The file's description field specifies how the import should be done:
      After saving the DataSet page an import button should appear below the file description.

      When you start the import the DataSet module creates a task (executed by Tasker) that will import the data in the background.
      You can monitor its execution and check its logs for errors.

      See the module's wiki for more details.
      The module was already used in three projects to import and handle large XML and CSV datasets. It has some rough edges and I'm sure it needs improvement so comments are welcome.
    • By dreerr
      TemplateEnginePug (formally TemplateEngineJade)
       
      This module adds Pug templates to the TemplateEngineFactory. It uses https://github.com/pug-php/pug to render templates.
      doctype html html(lang='en') head meta(http-equiv='content-type', content='text/html; charset=utf-8') title= $page->title link(rel='stylesheet', type='text/css', href=$config->urls->templates . 'styles/main.css') body include header.pug h1= $page->title if $page->editable() p: a(href=$page->editURL) Edit Project on GitHub: github.com/dreerr/TemplateEnginePug
      Project in modules directory: modules.processwire.com/modules/template-engine-pug/
       
      For common problems/features/questions about the Factory, use the TemplateEngineFactory thread.
       
    • By Robin S
      Pages At Bottom
      Keeps selected pages at the bottom of their siblings.
      A "bottom page" will stay at the bottom even if it is drag-sorted to a different location or another page is drag-sorted below it (after Page List is refreshed the bottom page will still be at the bottom).
      Newly added sibling pages will not appear below a bottom page.
      The module also prevents the API methods $pages->sort() and $pages->insertAfter() from affecting the position of bottom pages.
      Note: the module only works when the sort setting for children on the parent page/template is "Manual drag-n-drop".
      Why?
      Because you want some pages to always be at the bottom of their siblings for one reason or another. And someone requested it. 🙂
      Usage
      Install the Pages At Bottom module.
      Select one or more pages to keep at the bottom of their siblings. If you select more than one bottom page per parent then their sort order in the page list will be the same as the sort order in the module config.

       
      https://github.com/Toutouwai/PagesAtBottom
      https://modules.processwire.com/modules/pages-at-bottom/
    • By Robin S
      Another little admin helper module...
      Template Field Widths
      Adds a "Field widths" field to Edit Template that allows you to quickly set the widths of inputfields in the template.

      Why?
      When setting up a new template or trying out different field layouts I find it a bit slow and tedious to have to open each field individually in a modal just to set the width. This module speeds up the process.
      Installation
      Install the Template Field Widths module.
      Config options
      You can set the default presentation of the "Field widths" field to collapsed or open. You can choose Name or Label as the primary identifier shown for the field. The unchosen alternative will become the title attribute shown on hover. You can choose to show the original field width next to the template context field width.  
      https://github.com/Toutouwai/TemplateFieldWidths
      https://modules.processwire.com/modules/template-field-widths/