Jump to content
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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By gebeer
      Although the PW backend is really intuitive, ever so often my clients need some assistance. Be it they are not so tech savvy or they are not working in the backend often.
      For those cases it is nice to make some help videos available to editors. This is what this module does.
      ProcessHelpVideos Module
      A Process module to display help videos for the ProcessWire CMS. It can be used to make help videos (screencasts) available to content editors.
      This module adds a 'Help Videos" section to the ProcessWire backend. The help videos are accessible through an automatically created page in the Admin page tree. You can add your help videos as pages in the page tree. The module adds a hidden page to the page tree that acts as parent page for the help video pages. All necessary fields and templates will be installed automatically. If there are already a CKEditor field and/or a file field for mp4 files installed in the system, the module will use those. Otherwise it will create the necessary fields. Also the necessary templates for the parent help videos page and it's children are created on module install. The module installs a permission process-helpvideos. Every user role that should have access to the help video section, needs this permission. I use the help video approach on quite a few production sites. It is stable so far and well received by site owners/editors. Up until now I installed required fields, templates and pages manually and then added the module. Now I added all this logic to the install method of the module and it should be ready to share.
      The module and further description on how to use it is available on github: https://github.com/gebeer/ProcessHelpVideos
      If you like to give it a try, I am happy to receive your comments/suggestions here.
    • By Robin S
      A module created in response to the topic here:
      Page List Select Multiple Quickly
      Modifies PageListSelectMultiple to allow you to select multiple pages without the tree closing every time you select a page.
      The screencast says it all:

       
      https://github.com/Toutouwai/PageListSelectMultipleQuickly
      https://modules.processwire.com/modules/page-list-select-multiple-quickly/
    • By gebeer
      Hello all,
      sharing my new module FieldtypeImagePicker. It provides a configurable input field for choosing any type of image from a predefined folder.
      The need for it came up because a client had a custom SVG icon set and I wanted the editors to be able to choose an icon in the page editor.
      It can also be used to offer a choice of images that are used site-wide without having to upload them to individual pages.
      There are no image manipulation methods like with the native PW image field.
      Module and full description can be found on github https://github.com/gebeer/FieldtypeImagePicker
      Kudos to @Martijn Geerts. I used his module FieldTypeSelectFile as a base to build upon.
      Here's how the input field looks like in the page editor:

      Hope it can be of use to someone.
      If you like to give it a try, I'm happy to hear your comments or suggestions for improvement. Eventually this will go in the module directory soon, too.
    • By bernhard
      @Sergio asked about the pdf creation process in the showcase thread about my 360° feedback/survey tool and so I went ahead and set my little pdf helper module to public.
      Description from PW Weekly:
       
      Modules Directory: https://modules.processwire.com/modules/rock-pdf/
      Download & Docs: https://github.com/BernhardBaumrock/RockPDF
       
      You can combine it easily with RockReplacer: 
      See also a little showcase of the RockPdf module in this thread:
       
    • By ukyo
      FieldtypeFontIconPicker
      Supported Icon Libraries
      FontAwesome 4.7.0 Uikit 3.0.34 IonicIcons 2.0.1 Cahangelog
      NOTE: Module store data without prefix, you need to add "prefix" when you want to show your icon on front-end, because some of front-end frameworks using font-awesome with different "prefix".
      Module will search site/modules/**/configs/IconPicker.*.php and site/templates/IconPicker.*.php paths for FieldtypeFontIconPicker config files.
      All config files need to return a PHP ARRAY like examples.
      Example config file : create your own icon set.
      File location is site/configs/IconPicker.example.php
      <?php namespace ProcessWire; /** * IconPicker : Custom Icons */ return [ "name" => "my-custom-icons", "title" => "My Custom Icon Set", "version" => "1.0.0", "styles" => array( wire("config")->urls->templates . "dist/css/my-custom-icons.css" ), "scripts" => array( wire("config")->urls->templates . "dist/js/my-custom-icons.js" ), "categorized" => true, "attributes" => array(), "icons" => array( "brand-icons" => array( "title" => "Brand Icons", "icons" => array( "google", "facebook", "twitter", "instagram" ) ), "flag-icons" => array( "title" => "Flag Icons", "icons" => array( "tr", "gb", "us", "it", "de", "nl", "fr" ) ) ) ]; Example config file : use existing and extend it.
      File location is site/configs/IconPicker.altivebir.php
      <?php namespace ProcessWire; /** * IconPicker : Existing & Extend */ $resource = include wire("config")->paths->siteModules . "FieldtypeFontIconPicker/configs/IconPicker.uikit.php"; $url = wire("config")->urls->templates . "dist"; $resource["scripts"] = array_merge($resource["scripts"], ["{$url}/js/Altivebir.Icon.min.js"]); $resource["icons"]["flag-icons"] = [ "title" => "Flag Icons", "icons" => array("tr", "en", "fr", "us", "it", "de") ]; $resource["icons"]["brand-icons"]["icons"] = array_merge($resource["icons"]["brand-icons"]["icons"], array( "altivebir" )); return $resource; After you add your custom config file, you will see your config file on library select box. Library Title (Location Folder Name).

      If your library categorized and if you have categorized icons set like uikit and fontawesome libraries, you will have category limitation options per icon field or leave it empty for allow all categories (default).

      Example : output
      if ($icon = $page->get("iconField")) { echo "<i class='prefix-{$icon}' />"; } MarkupFontIconPicker Usage
      // MarkupFontIconPicker::render(YourIconField=string, Options=array) echo MarkupFontIconPicker::render($page->YourIconField, [ 'prefix' => 'uk-icon-', // Icon class prefix, if you have different prefix, default is : "fa fa-" 'tag' => 'span', // Icon tag default is : "i" 'class' => 'fa-lg', // If you have extra cutom classes, for example : icons sizes, Array or Sting value 'style' => 'your custom styles if you have' // Array or String Value ]); Theme support

      Search support

      Category support

       
×
×
  • Create New...