adrian

Tracy Debugger

Recommended Posts

Hi Adrian,

1-I just set PW’s debug mode in the config file…I think previously it was set to false, but tracy was working anyway. 

The other questions I am not sure how to go about solving. I think I will try to uninstall then reinstall Tracy first, if that does not work I will see if I can go over each bullet point. Thanks!

 

Share this post


Link to post
Share on other sites
3 minutes ago, ryanC said:

I think previously it was set to false, but tracy was working anyway

That setting doesn't affect Tracy's behavior, but if Tracy isn't working it will provide info that you wouldn't have otherwise.

Let me know how you go with reinstalling, or looking at those bullet points.

  • Like 1

Share this post


Link to post
Share on other sites

Hi, I just uninstalled/reinstalled, still just that little icon on the left hand side. 

-In my Chrome dev area I get network errors, but none appear to be about Tracy.
-I don’t know how to check if there are permission issues in the Tracy folder
-I went here to download Tracy…https://tracy.nette.org/
and it seems to have the same folders and files that processwire installed.

I think yesterday (when it was working) I minimized the panel by clicking the little arrow and I don't remember seeing it after that. 

 

Share this post


Link to post
Share on other sites
1 minute ago, ryanC said:

I think yesterday (when it was working) I minimized the panel by clicking the little arrow and I don't remember seeing it after that. 

What happens when you click the icon to maximize it :)

Share this post


Link to post
Share on other sites

That's the thing, it's not behaving like a link. When I hover over it, I get a tooltip that says it's Tracy, but that's it. My cursor doesn't change like it would if I was hovering over a link, it's just like its inline text. 

So when I hit inspect element (over the icon) those are the errors in the screenshot from my first post.

Share this post


Link to post
Share on other sites
Just now, ryanC said:

That's the thing, it's not behaving like a link. When I hover over it, I get a tooltip that says it's Tracy, but that's it. My cursor doesn't change like it would if I was hovering over a link, it's just like its inline text. 

Ok, sorry, I jumped to a quick conclusion there :)

I think the key error in the console is the 403 - I think that is likely the file permission issue. If you go to the Network tab and reload the page, hopefully you can see the file that is not being loaded. This comes back to my file permission request. Can you temporarily set all files in /site/modules/TracyDebugger to 0777 so we can see if that is the issue. Obviously we'll sort out properly after that.

Share this post


Link to post
Share on other sites
1 minute ago, ryanC said:

Here's everything in one window:

You still haven't clicked on the Network tab.

I still think you should try the 0777 because I think that's very likely the problem.

Share this post


Link to post
Share on other sites

Do I make that change to the "TracyDebugger.module" file on my desktop, or is this in the processwire api itself?

Share this post


Link to post
Share on other sites
Just now, ryanC said:

Do I make that change to the "TracyDebugger.module" file on my desktop, or is this in the processwire api itself?

Let's take this to PM to avoid spamming all the followers here :)

Share this post


Link to post
Share on other sites

Ok, @szabesz, @bernhard and anyone else who is interested :)

I have started populating the ReadMe with documentation (https://github.com/adrianbj/TracyDebugger).

I have made a start on the Table of Contents (TOC) and done a quick population of some content for Captain Hook and the Console. Basically just copied from the original Tracy blog post at the moment.

The TOC links work on Github, but unfortunately they don't work in @netcarver's Module Release Notes, but I doubt there is anything that can be done about that. CTRL/CMD+F always works fine though.

I might spend some more time today fleshing things out a little more, but I would really love some help populating these docs if anyone feels motivated - PR's gratefully accepted :)

 

  • Like 2

Share this post


Link to post
Share on other sites

@adrian I'll see what I can do over the weekend to try and get things working for TOCs in the readme files. Release Notes displays any files that start with "readme" - so you can split different topics into different readme files if that helps.

  • Like 1

Share this post


Link to post
Share on other sites
2 minutes ago, netcarver said:

Remember, Release Notes displays any and all files that start with readme - so you can split different topics into different readme files if that helps.

I thought about that, but I think without a way to link from one file to another it would actually be a poorer experience in my use case, but I'll keep it in mind as the docs start to flesh out - they could end up quite large :)

Share this post


Link to post
Share on other sites
2 hours ago, adrian said:

I have started populating the ReadMe with documentation (https://github.com/adrianbj/TracyDebugger).

Minor change of plan. The ReadMe was going to be too long for the entry in the modules directory and also the TOC links didn't work there, so I have moved the docs into DOCUMENTATION.md and @netcarver has committed a change to ModuleReleaseNotes (which if you don't have, you should get) so that this DOCUMENTATION.md will now be displayed in the module settings, like this:

5a31c282d221b_ScreenShot2017-12-13at3_48_12PM.png.53750ae4740c6740ff845406c1a6b303.png

I think I am really happy with this approach!

Once the docs are more comprehensively populated, I will adjust the links from the Selector panel info icons to point to the appropriate panel info here, rather than the old blog post.

  • Like 4

Share this post


Link to post
Share on other sites

Hi @adrian,

I'm running 4.8.23 on localhost (pw 3.0.62) and I'm getting the following error when I enable the snippet runner:

UnexpectedValueException: RecursiveDirectoryIterator::__construct(/xxx/site/templates/TracyDebugger/snippets/): failed to open dir: No such file or directory in /xxx/site/modules/TracyDebugger/panels/SnippetRunnerPanel.php:254

Permissions are 777 on snippets folder.

Obviously I missed something, I just don't know what. :)

Share this post


Link to post
Share on other sites
1 minute ago, rick said:

Hi @adrian,

I'm running 4.8.23 on localhost (pw 3.0.62) and I'm getting the following error when I enable the snippet runner:

UnexpectedValueException: RecursiveDirectoryIterator::__construct(/xxx/site/templates/TracyDebugger/snippets/): failed to open dir: No such file or directory in /xxx/site/modules/TracyDebugger/panels/SnippetRunnerPanel.php:254

Permissions are 777 on snippets folder.

Obviously I missed something, I just don't know what. :)

Do you have the config setting for the snippet runner pointing to the correct folder - remember there are two options?

Share this post


Link to post
Share on other sites
2 minutes ago, adrian said:

Do you have the config setting for the snippet runner pointing to the correct folder - remember there are two options?

My bad. I had snippets under modules. Since I don't want extra stuff in my templates folder I set it to use assets. Works fine now. Sorry for the oversight on my part.

  • Like 1

Share this post


Link to post
Share on other sites

I've had this issue for a while but am just now getting around to posting about it – if i am seeing this correctly, minimizing the tracy bar is adding a 'hidden' class to the body, which makes any site using bootstrap turn completely white, since in bootstrap framework, there is this rule:

.hidden {
    display: none;
    visibility: hidden;
}

would be great if it didn't do that, since it scares some people when they minimize the toolbar and lose the site;

  • Like 1

Share this post


Link to post
Share on other sites

Thanks for the report @Macrura - I have a fix in place here and I'll commit later today or tomorrow - just in the middle of some much larger changes. 

  • Like 2

Share this post


Link to post
Share on other sites

hi @adrian

today I revisited my old idea of a hook recorder ( see https://processwire.com/talk/topic/10857-making-hooks-visible-hookrecorder/ and this post by @Robin S https://processwire.com/talk/topic/12208-tracy-debugger/?do=findComment&comment=137508 ). 

I tried another approach than Robin suggested and failed  (just found his post now by coincidence) :) Another possibility might be to modify the Filecompiler somehow so that it adds logging functions to every "public function ___" method.

I think hooks are still hard to grasp, especially for new users. See https://processwire.com/talk/topic/18037-2-date-fields-how-to-ensure-the-second-date-is-higher/?do=findComment&comment=158168 for example (that brought up my idea of the hookrecorder again). Robins solution does not sound too hard to implement. Maybe it's even easier now you integrated the ready/init/finished option for the console?

But even for advanced developers this feature could be very handy i think! Looking forward to hearing your thoughts and thanks for all the input for datatables ;)

 

Share this post


Link to post
Share on other sites

Hey @bernhard - I'd be happy to implement this in Tracy.

But first, I think I need to better understand exactly what you want to see in the output. Have you looked at the "Hooks Triggered" section of the Debug Mode panel?  That is called on each page request. What additional information would want to see. Sorry, I feel like I am not quite fully getting it yet.

Thanks!

  • Like 1

Share this post


Link to post
Share on other sites
19 hours ago, adrian said:

But first, I think I need to better understand exactly what you want to see in the output. Have you looked at the "Hooks Triggered" section of the Debug Mode panel?  That is called on each page request. What additional information would want to see. Sorry, I feel like I am not quite fully getting it yet.

Thanks adrian. I've never really used the debug tools as I didn't find them really helpful. Maybe I'm missing something and just don't know how to use them properly? But what I wanted to achieve with the hookrecorder was some kind of execution plan of all hookable methods. A list where you can see which method get's called after the other. Ideally it would also show some additional information (like which page was saved, wich arguments where provided...).

Maye it would also be possible to have some kind of nesting in it? The result could be something like this:

ProcessPageView::execute
ProcessPageView::ready
	ProcessPageEdit::buildForm (id=mypageid, ...)
		InputfieldWrapper::render (name=myfield, ...)
			Inputfield::render (name=myfield1, ...)
			Inputfield::render (name=myfield2, ...)
			Inputfield::render (name=myfield3, ...)
ProcessPageView::finished

I have no idea if that Execution Plan is correct... I'm quite familiar with hooking all around and looking for the right hook in the code but still I don't know exactly WHAT is going on WHEN. But looking on sime kind of list like above everybody would instantly get what is going on and would get a tremendously better understanding of how pw works. Then one could go further and look into the related class' code and inspect it.

This list could also show additional info, as I already mentioned. And what I mean is on the one hand information about some variables what is currently happening (like which field is going to be rendered etc.) and on the other hand maybe it could list all hooks that are currently applied to this method (similar to the hooks list of the debug tools, listing hooks by priority so that you instantly get an idea of what is going on).

I think such a tool would not only be of HUGE help for newbies but also for experienced devs. For example you could have a problem with some kind of pagesave actions... you have a hook that should change the page title to "myval" after every pagesave...

Pages::save (id=123)
	execute hook from file /site/ready.php on line 12: collapsed hook code
		[...] $page->title = 'myval'; [...]
Pages::saveReady (id=123)
	execute hook from file /site/modules/mymodule.module.php on line 240:
		[...] $page->title = 'my wrong value'; [...]
Pages::saved (id=123)
	no hooks executed

you would instantly see what's going on and that there is a conflicting saveReady hook overwriting the page title.

I hope you get my point now. Or maybe I should start using XDebug and that's exactly what it is doing? :) 

PS: The list of hooks we have in the debug tools seems to be a list of all active hooks? And the sorting order is not helpful for me - it is even confusing... Is there any system in the order they are presented?

  • Like 2

Share this post


Link to post
Share on other sites
1 hour ago, bernhard said:

But what I wanted to achieve with the hookrecorder was some kind of execution plan of all hookable methods.

So basically a stack trace of hooks and their parameters and results. Correct?  Personally, I think this would be great, especially for those of us who have not dove into the hook pool yet.

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 Macrura
      Field Descriptions Extended
      This module enables you to extend field descriptions by dividing short descriptions with a longer text that is revealed in a toggle.
      Modules Directory: http://modules.processwire.com/modules/field-descriptions-extended/
      Github: https://github.com/outflux3/FieldDescriptionsExtended
      Extending your field descriptions using the standard field's description field.
      Once this module is installed, it will automatically search your description field for the presence of 5 dashes (-----).
      Any content above the 5 dashes will be visible and the content below the dashes will be hidden. A 'More...' link will appear at the end of the short description which when clicked will reveal the rest of the description.
      Using Simple Markdown Editor with the description field
      If you have Simple Markdown Editor (InputfieldSimpleMDE) installed, you can enable the field description to have that editor.
      *When using Simple MDE, you can use the button (Insert Horizontal Line) instead of typing 5 dashes. More about SimpleMDE.
      Extending your field descriptions using content from a ProcessWire Page for the field description.
      You may use the content from a ProcessWire page as a field description. This would allow you to easily insert images, links, and use hanna codes.
      To use page content for your field descriptions, please follow these instructions:
      Install Select Fields module (FieldtypeFields) http://modules.processwire.com/modules/fieldtype-fields/ Create a new field using this field type, e.g. field_select. Add the field to any template you will be using for your field descriptions. Setup your help pages (for example under a settings branch) where you will store the field description content,using the template containing the Field Select. Add content to a page and select the field where that content should show. To show a short text before the link to the longer content, separate them with 5 dashes Be sure to update your settings on this page, first enable page content descriptions,then specify the name of the Select Fields field, template to search, and content field. If you create a field description using this method, please note that the description field must be blank for contexts where you want the page content to appear.
      You can freely use template context for field descriptions, but the Page Content method is not context sensitive and will display under all contexts where the description is blank.
      ----
      original post:
      This is a new module, hope to release soon, which allows extended field descriptions, in currently 2 ways.
      The main feature of the module is that you can have a short description and then a 'more...' link which drops down a longer block of text.
      This is achieved by separating the intro/visible text and the rest with 5 dashes.

      Example setup:

      the 2nd way is if you are using AdminThemeUiKit, you can show extended field instructions in a panel. The content of the panel is edited on a regular PW page. This use case would probably not be that common, but if you had a field that required some extended instructions for how to use, this could be useful; Also, since this allows you to target information and instructions down at the field level, it could reduce the amount of documentation needed on a global level, since it is a lot more context targeted.

    • By Robin S
      Breadcrumb Dropdowns
      Adds dropdown menus of page edit links to the breadcrumbs in Page Edit.

      Installation
      Install the Breadcrumb Dropdowns module. The module requires ProcessWire >= v3.0.83 and AdminThemeUikit.
      There is a checkbox option in the module config that determines if the breadcrumb dropdowns will include pages that the user does not have permission to edit.
      Features/details
      The module adds an additional breadcrumb item at the end for the currently edited page. That's because I think it's more intuitive for the dropdown under each breadcrumb item to show the item's sibling pages rather than the item's child pages. In the dropdown menus the current page and the current page's parents are highlighted in a crimson colour to make it easier to quickly locate them in case you want to edit the next or previous sibling page. If the option to include uneditable pages is selected then those pages are indicated by a reduced text opacity and the "not-allowed" cursor is shown on hover. There is a limit of 25 sibling pages per dropdown for performance reasons and to avoid the dropdown becoming unwieldy. Incompatibilities
      This module replaces the AdminThemeUikit::renderBreadcrumbs method so will potentially be incompatible with other modules that hook the same method.
       
      https://modules.processwire.com/modules/breadcrumb-dropdowns/
      https://github.com/Toutouwai/BreadcrumbDropdowns
    • By joshuag
      Hey guys, 
      Thought I would share a quick preview of Designme. A module we (Eduardo @elabx and I) are building for visually laying out your templates/edit screens. 🙂
      This is a really quick, zero polish screen grab. FYI. 
      Video #2 - UPDATE
      This new video shows the following features in Designme:
      Re-arranging fields via Drag & Drop Re-sizing fields via Dragging. Adjusting field settings - with live refresh. Working on "hidden" fields while Designme is active. Creating New fields. Deleting fields. Creating/Deleting Tabs. Dragging fields between tabs. Creating fieldsets. Tagging/Un-tagging fields. Fields without headers expand when hovered (like checkboxes). Live filtering of fields in the sidebar. Ability to adjust (all) Template settings without leaving Designme. Template File Tree Editing Template files source code with ACE Editor. Editing Multiple files with ACE Editor. (New Tabs) Saving files. Techie stuff Fields load their own js/css dependancies. *ready to use on creation (*most fields)  Everything happens via Ajax to ProcessPageEdit (via module + hooks). Designme has a JS api that you can use.  All actions trigger events.  We would love any detailed feedback on what you see so far. If you are interested in testing Designme. Let me know below. 🙂
       
       
      Video #1. 
       
    • 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 tpr
      ProcessNetteTester
      Run Nette Tester tests within ProcessWire admin.
      (continued from here)

      Features
      AJAX interface for running Nette Tester tests, in bulk or manually display counter, error message and execution time in a table run all tests at once or launch single tests show formatted test error messages and report PHP syntax errors stop on first failed test (optional) hide passed tests (optional) display failed/total instead passed/total (optional) re-run failed tests only (optional) auto scroll (optional) include or exclude tests based on query parameters start/stop all tests with the spacebar reset one test or all tests (ctrl+click) https://modules.processwire.com/modules/process-nette-tester/
      https://github.com/rolandtoth/ProcessNetteTester