adrian

Tracy Debugger

Recommended Posts

7 hours ago, bernhard said:

I still have the bug on the AOS language switcher z-index. Any news on this?

I think this is something that @tpr needs to take care of in AOS, but if someone know better, please correct me.

8 hours ago, bernhard said:

On the config var the description column is very large, leading to a horizontal scrollbar. Maybe it would make sense to use text-overflow: ellipsis; here?

I actually think I am OK with the horizontal scroll in this case. I'd rather be able to read it all and I don't want to go with line break either. If others think this is annoying, please let me know and I'll reconsider.

8 hours ago, bernhard said:

Is it intended that the links to the api ref opens in the same window? I know we can middle-click, but I wonder if it was better to open it in a new tab by default?

Over the last few years I have come to really dislike forced new window/tab links unless there is a chance of data loss which I guess in this situation is possible if you're editing a page at the time, so I have introduced a config option under the Misc section to let you guys decide. This is the same as the option for the PW Info panel. I have also added it to the Captain Hook panel as well. So guys can choose what you prefer.

7 hours ago, gmclelland said:

How about adding a full screen button to the API Explorer panel?  Like it is with the Console panel.

I have added this to the latest version - also added to the Captain Hook panel as well.

9 hours ago, bernhard said:
10 hours ago, adrian said:

I am actually thinking about a link from the property to open the Console panel with the $object->property wrapped in a d() call, eg:

Sorry, I don't get what you are talking about

It's a link to automatically insert that code into the Console panel so you can easily dump it to get the value. Maybe it will make more sense when it's done 🙂

  • Thanks 1

Share this post


Link to post
Share on other sites

Hi Adrian -  is the gap between the dump heading and the dump output deliberate? I think it would look better without a gap.

2018-10-25_110001.png.5f1a32b96c7d23e276bbd0f7eea24ee7.png

  • Like 1

Share this post


Link to post
Share on other sites
9 minutes ago, Robin S said:

Hi Adrian -  is the gap between the dump heading and the dump output deliberate? I think it would look better without a gap.

2018-10-25_110001.png.5f1a32b96c7d23e276bbd0f7eea24ee7.png

Recently introduced, unintentional bug 🙂

I have just committed a fix, although no version number bump just yet because I am working on other changes.

  • Like 1

Share this post


Link to post
Share on other sites

New version of the API Explorer. 

1) It now shows all core classes (rather than the previous select list), but it excludes those classes with matching API variables avoid duplicate content.

2) By default, methods inherited from Wire, WireArray, or WireData are no longer shown which dramatically decreases the size of the panel and makes it much easier to find what you are looking for. However if you want to see all methods, then you can check the new "Include inherited methods" config setting.

I would really appreciate some feedback on this new version. I am thinking about maybe showing inherited methods for the core classes, but not for the API variables (objects), but I'd really like to get thoughts from you guys on what you think will be most useful - I think it's a challenge to balance usefulness and clarity.

Thanks!

Share this post


Link to post
Share on other sites

Another question for you all - in addition to the core objects and classes, would you find it useful to also see these for core and site module classes as well? Maybe optional?

Share this post


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

for core and site module classes as well? Maybe optional?

+1 for optional 🙂

Share this post


Link to post
Share on other sites

Lots of improvements to the API Explorer have been committed and as far as I can tell it should now include all methods and properties for all PW objects and classes.

It's now definitely ready for primetime although I am sure I'll think of other improvements to add 🙂

Honestly I am learning about lots of methods/properties I didn't know about!

Hopefully you guys will find it the best first stop for api docs.

  • Like 4

Share this post


Link to post
Share on other sites

Brand new numParents() method from the latest PW dev showing up in the API Explorer 🙂

image.thumb.png.328370a51d9985799cbb34c153d9d1cc.png

  • Like 3

Share this post


Link to post
Share on other sites

Inline with my last comment, I am thinking about adding an alert (with orange icon) when there are new properties/methods available after you upgrade to a new version of PW. Haven't decided on the exact interface yet, but if you like the idea and have any thoughts, feel free to suggest, but probably a simple note at the top of the panel detailing those new options and also highlighting in the tables. Probably with an option to "acknowledge" that you've seen the options to remove the notice. Something like that anyways.

  • Like 2

Share this post


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

Probably with an option to "acknowledge" that you've seen the options to remove the notice. Something like that anyways.

+1, yep, it would be great to be able to decide when to dismiss it. I tend not to heave time to read all such things when they happen to pop-up. Also, if we could copy/paste them, then I could save it into my notes for later inspection.

Share this post


Link to post
Share on other sites

@adrian

While wokring on a site I faced a problem with hook and bd call in it.

wire()->addHookAfter("Page(template=blog-category)::path", function($e) {
	$page = $e->object;
	bd($e);
	$pages = wire('pages');
	$user = wire('user');
	$language = $user->language;
	$langSegment = $pages->get("/")->localPath($language);
	$pageName = $page->localName($language, true);
	$e->return = $langSegment . "$pageName/";
});

Such hook leads to 'Fatal error: Allowed memory size'. I have tested it on three different installations, got the same result even on clean installation with only TracyDebugger module. PW 3.0.117 and 3.0.116, the latest module version, PHP 7.2.4. 

Share this post


Link to post
Share on other sites

Hi @Zeka - I think is probably just a result of trying to bd() lots of complex PW objects. Try replacing the bd call with bd($e->object->title) and see if that helps. Or maybe you could use bd($e, [1]) as a shortcut to reduce the maxDepth of the dump.

The main thing is I don't think it's a problem with Tracy but rather just how much content is being dumped. How many bd() calls are being made in this hook in your setup?

Share this post


Link to post
Share on other sites

@adrian

Thanks, reducing of the maxDepth depth helped. But it's strange, as in earlier versions I have used bd calls in such hooks without maxDepth tuning. 

Share this post


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

@adrian

Thanks, reducing of the maxDepth depth helped. But it's strange, as in earlier versions I have used bd calls in such hooks without maxDepth tuning. 

Would you mind checking what is the last old version of Tracy that doesn't have an issue with that hook in your setup? If there has been some change, I'd love to help sort it out. Perhaps it's when I introduced the debugInfo / Iterator / Full Object tabs in the dumped results? This is the commit where this was first introduced: https://github.com/adrianbj/TracyDebugger/commit/104a9457ec1eae78b46d139a631f798b2a042bf0

Share this post


Link to post
Share on other sites

@adrian

I tried such hook (without conditions) on PW 3.0.105 and TD 4.10.22 and it works as expected. I got 360 dumps. So, yes, probably it is somehow relative to new tabs in dump panel.

	wire()->addHook("Page::path", function($e) {
		bd($e);
		$page = $e->object;
		$e->return = "/{$page->name}/";
	});

 

  • Like 1

Share this post


Link to post
Share on other sites

Thanks for doing that test. Now the problem is that I am not really sure what to do. You do have the option to change what tabs are output:

image.png.cf5090d4167a23f526a2a19238218830.png

so I guess if you're coming across this a lot and don't want to (or can't increase) the PHP memory limit, then perhaps the best option is to drop back to one tab. Would you mind confirming that works for me?

 

Share this post


Link to post
Share on other sites

[offtopic]

just wanted to mention that always when I log into a site with an older version of tracy I realize how much better the new not-so-colored theme is, thanks for that @adrian and @tpr 🙂 

  • Like 3

Share this post


Link to post
Share on other sites
On 10/24/2018 at 11:19 PM, adrian said:
On 10/24/2018 at 1:54 PM, bernhard said:

I still have the bug on the AOS language switcher z-index. Any news on this?

I think this is something that @tpr needs to take care of in AOS, but if someone know better, please correct me.

@bernhard Yesterday I tried to replicate this but couldn't. Have you modified z-index in tracy, or have set sticky header in aos?

  • Thanks 1

Share this post


Link to post
Share on other sites

Z index for sure not. Sticky header I think also no. I have to try tomorrow to narrow it down...

Share this post


Link to post
Share on other sites
On 9/27/2018 at 3:02 AM, bernhard said:

One thing I noticed is that when I reload the page after adding a folder to the ignored-list the Todo-Panel was not activated any more. I activated it via the checkbox in the panel selector and clicked "sticky". After saving the module's settings this setting was gone. Is this a bug? Or can I activate this panel in another way?

Just wanted to let you know, that this will no longer be a problem. I have removed the code that cleared the sticky panels cookie when saving the config settings. I'll keep an eye on things because I am still not sure exactly why I added it in the first place, but it's definitely annoying 🙂

 

On another note, core modules and site modules classes are now optional available in the API Explorer panel, along with lots of other improvements.

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Hey @adrian ,

I'm just developing a new module and using your todo-panel all the time. Now I had the plan to place some files in /site/assets and some in /site/templates, both having the folder name MyModule.

The "problem" is that I want the files in /site/templates indexed by the todo-panel, but not the files in /site/assets (that's an external library).

Is there any chance to make the filter more specific? Maybe a regex option? No problem at all if that is not easily possible, but if it is, I'd be thankful for such a feature 🙂 

Share this post


Link to post
Share on other sites
44 minutes ago, bernhard said:

Hey @adrian ,

I'm just developing a new module and using your todo-panel all the time. Now I had the plan to place some files in /site/assets and some in /site/templates, both having the folder name MyModule.

The "problem" is that I want the files in /site/templates indexed by the todo-panel, but not the files in /site/assets (that's an external library).

Is there any chance to make the filter more specific? Maybe a regex option? No problem at all if that is not easily possible, but if it is, I'd be thankful for such a feature 🙂 

I agree the current approach isn't great, but is it possible to simply add "/site/assets/MyModule" to the ignore list. Doesn't that achieve what you want?

If not, I'd certainly be happy for a regex approach.

  • Like 1

Share this post


Link to post
Share on other sites

Thx @adrian didn't know this was possible! Of course that's totally sufficient 🙂 

I guess I tried it with wrong directory separators because I'm on Windows... This does work now, but it might be better (possible?) to stick with one version of the slash?

site/modules\MyModule\src

 

  • Like 1

Share this post


Link to post
Share on other sites

New "Adminer" database GUI panel just added.

image.thumb.png.f6425cc60bdaf152b44f75527a4ad1f9.png.6b4315b8dfb634592e45d83b2921e858.png

A huge thanks to @Robin S for making me take another look at this long forgotten tool and for helping with many suggestions regarding the implementation in Tracy and debugging several issues.

There is one outstanding one on his local Windows dev setup that I can't reproduce at all and he also isn't seeing on a live server. He is getting session_start / headers already sent error. 

Could someone else on Windows (maybe @bernhard) take a look and let me know if you have the same problem as well.

Actually Robin - any chance you are running the SessionHandlerDB modules on that local setup?

The color scheme is configurable in the Tracy settings.

I have used this already on a live server to help debug something and it would have taken much longer to go find the cpanel credentials, and navigate my way to PHPMyAdmin. This logs you in automatically and is virtually instant.

I am away for the next 10 days so if you find any problems, they will most likely have to wait till I'm back.

Hope you find it useful!

  • Like 6
  • Thanks 1

Share this post


Link to post
Share on other sites

Quick note to let you know that it's also possible to run Adminer directly via: /processwire/setup/adminer/ which may be preferable if you have lots of work to do and want it open in a more "permanent" way. At the moment I set the page as hidden so it actually won't appear under the Setup menu - I can change this, or perhaps I can have a link from the Adminer Tracy panel to open it this way. Any thoughts on which would be best?

  • Like 1

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 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/
    • By horst
      Croppable Image 3
      for PW 3.0.20+
      Module Version 1.1.16
      Sponsored by http://dreikon.de/, many thanks Timo & Niko!
      You can get it in the modules directory!
      Please refer to the readme on github for instructions.
       
      -------------------------------------------------------------------------
       
      Updating from prior versions:
       
      Updating from Croppable Image 3 with versions prior to 1.1.7, please do this as a one time step:
      In the PW Admin, go to side -> modules -> new, use "install via ClassName" and use CroppableImage3 for the Module Class Name. This will update your existing CroppableImage3 module sub directory, even if it is called a new install. After that, the module will be recogniced by the PW updater module, what makes it a lot easier on further updates.
      -------------------------------------------------------------------------
       
      For updating from the legacy Thumbnail / CropImage to CroppableImage3 read on here.
       
      -------------------------------------------------------------------------
       
    • By MoritzLost
      UPDATE: I have published a stable version of this module!
      Discussion thread:
      Github: https://github.com/MoritzLost/TextformatterPageTitleLinks
      ---
      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 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: