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 blad
      Hi guys!
      I just uploaded a module to explore files based on elFinder. By default it will show the "Files" folder.
      Screenshots:

      Video:
       
      To do:
       More options To fix:
       The function of rotating or scaling an image fails  Image editors V 1.01 (view issue)
      Fixed the bug working with the Multi-Language support ( translation of folders ). Fixed the name of elfinder.en  Github:
      https://github.com/LuisSantiago/ProcessElFinder/
      I hope you like it.
    • By BitPoet
      I'm really in love with FormBuilder, but the one thing missing to match all my end users' expectations were repeatable field groups. Think repeaters, in ProcessWire terms. Our primary application of PW is our corporate intranet, so "lines" of fields are quite common in the forms I build. We have all kinds of request forms where the information for a varying number of colleagues needs to be entered (from meal order to flight booking request) and where it is simply impractical to send a form for each, and I don't want to clutter my forms with multiple instances of fields that may only get used ten percent of the time.
      That's why I started to build FormBuilderMultiplier (link to GitHub).
      What it does:
      Adds an option to make a regular Fieldgroup repeatable Lets you limit the number of instances of a Fieldgroup on the form Adds an "Add row" button the form that adds another instance of the Fieldgroup's fields Adds a counter suffix at the end of every affected field's label Stores the entered values just like regular fields Makes the entered values available in preview and email notifications Supports most text based fields, textareas and selects (really, I haven't had enough time to test all the available choices yet) What it doesn't do (yet):
      Support saving to ProcessWire pages (i.e. real Repeaters) I haven't tested all the validation stuff, Date/Time inputs etc. yet, but since I'm utterly swamped with other stuff at work, I didn't want to wait until I have it polished. Any feedback is welcome. There might also be some issues with different output frameworks that I haven't encountered yet. The forms I work with mostly use UIKit.
      Status:
      Still alpha, so test well before using it in the field.
      Known issues:
      When rows are added, the form's iframe needs to be resized, which isn't completely clean yet.
      How it works:
      The Fieldgroup settings are added through regular hooks, as is the logic that adds the necessary field copies for processing the form and displaying previews.
      "Multiplied" field instances are suffixed with _NUM, where NUM is an incremental integer starting from 1. So if you have add two fields named "surname" and "givenname" to a fieldgroup and check the "multiply" checkbox, the form will initially have "surname_1" and "givenname_1" field (I'm still considering changing that to make the risk to shoot oneself into the foot by having a regular "surname_1" field somewhere else in the form less likely).
      When a "row" is added, the first row is cloned through JS and the counter in the fields' IDs, names and "for" attributes as well as the counter in the label are incremented before appending the copies to the Fieldset container in the form.
      To keep backend and frontend in sync, a hidden field named [name of the fieldset]__multiplier_rows is added to the form. Both the backend and the frontend script use this to store and retrieve the number of "rows".
      ToDo:
      Naturally, add the option to store the data in real repeaters when saving to pages. Do a lot of testing (and likely fixing). Make a few things (like the "Add row" button label etc.) configurable in field(set) context. Add a smooth API to retrieve the multiplied values as WireArrays. The mandatory moving screenshot:

    • By MoritzLost
      Hello there,
      I'm working on a tiny textformatter module that searches the text for titles of other pages on your site and creates hyperlinks to them. I'm not sure if something like this exists already, but I haven't found anything in the module directory, so I wrote my own solution 🙂
      It's not properly tested yet and is still missing some functionality I would like to implement, so at the moment it should be considered in BETA. Features include limiting the pages that will get searched by template, and adding a custom CSS class to the generated hyperlinks. As I'm writing this I noticed that it will probably include unpublished and hidden pages at the moment, so yeah ... it's still in development alright 😅
      You can download the module from Github:
      https://github.com/MoritzLost/TextformatterPageTitleLinks
      There's some more information in the readme as well.
      Anyway, let me know what you think! I'm happy about any feedback, possible improvements or ideas on how to improve the module. Cheers.
    • By adrian
      This module provides a way to rapidly generate Page fields and the required templates and pages for use as a drop down select (or any other Page field type).
      This module will let you create a full page field setup in literally a few seconds 
      To use, run Page Field Select Creator from the Setup Menu
      Enter a Field Title, eg: Room Types Select Options - These will become the child pages that will populate the page field select options. There are two different options.
       
      Option 1. TITLE FIELD ONLY - enter one option per line, eg:
       
      Single
      Double
      Suite
       
       
      Option 2. MULTIPLE FIELDS - the first line is used for the field names and the first field must be 'Title'. Subsequent lines are the values for the fields, eg:
       
      Title, Number of Beds, Number of People, Kitchen Facilities
      Single, 1, 1, Fridge Only
      Double, 2, 2, Fridge Only
      Suite, 3, 6, Full Kitchen
        Choose the parent where the page tree of options will be created, eg a hidden "Options" parent page Select a "Deference in API as" option depending on your needs Choose the input field type Check whether "Allow new pages to be created from field?" should be enabled. As an example, if you entered "Room Types" as the field title, you would end up with all of the following automatically created:
      a fully configured page field called: room_types MULTIPLE FIELDS OPTION - 3 additional fields - number_of_beds, number_of_people, kitchen a parent template called: room_types a child template called: room_types_items (with either just a title field, or with the 3 additional fields as well) a parent page called: Room Types a series of child pages named and titled based on the per line entries in the Select Options textarea The templates are configured such that the "room_types_items" child template can only have the main "room_types" template as a parent, and vice versa.

      Then all you have to do is add the newly created page field to any template you want and you're ready to go!
       
      You can grab it from:
       
      Modules directory: http://modules.processwire.com/modules/process-page-field-select-creator/
      Github: https://github.com/adrianbj/ProcessPageFieldSelectCreator
       

    • By bernhard
      WHY?
      This module was built to fill the gap between simple $pages->find() operations and complex SQL queries.
      The problem with $pages->find() is that it loads all pages into memory and that can be a problem when querying multiple thousands of pages. Even $pages->findMany() loads all pages into memory and therefore is a lot slower than regular SQL.
      The problem with SQL on the other hand is, that the queries are quite complex to build. All fields are separate tables, some repeatable fields use multiple rows for their content that belong to only one single page, you always need to check for the page status (which is not necessary on regular find() operations and therefore nobody is used to that).
      In short: It is far too much work to efficiently and easily get an array of data based on PW pages and fields and I need that a lot for my RockGrid module to build all kinds of tabular data.

      Basic Usage

       
      Docs & Download
      https://modules.processwire.com/modules/rock-finder/
      https://github.com/BernhardBaumrock/RockFinder
       
      Changelog
      180817, v1.0.6, support for joining multiple finders 180810, v1.0.5, basic support for options fields 180528, v1.0.4, add custom select statement option 180516, change sql query method, bump version to 1.0.0 180515, multilang bugfix 180513, beta release <180513, preview/discussion took place here: https://processwire.com/talk/topic/18983-rocksqlfinder-highly-efficient-and-flexible-sql-finder-module/