adrian

Tracy Debugger

Recommended Posts

Just an FYI - in the Console panel you can now do mixed HTML/PHP without needing to add a php closing tag first.

<p>Welcome to the <?=$page->name?> page!</p>

 

File-based snippets (Snippet Runner) can be plain html, plain php, or mixed html/php, but they must have an opening php tag as per normal PHP requirements.

The Console panel does not require an opening PHP tag (although having one will still work). You can use mixed html/php as per the example above, but for a pure HTML file you will need an initial ?> before the HTML to make it work, eg:

?>
<p>Welcome to this page</p>

Plain html in the Console seems like a pretty uncommon use case, so hopefully this gives us the most flexibility without too much weirdness.

  • Like 1

Share this post


Link to post
Share on other sites

Hi,

I don't understand why request info panel is not displaying correctly.

If I remove server request and Input cookie, there is nothing in the panel, so I guess it kind of working correctly.

Thanks

PW 3.0.48 Tracy 4.6.12

 

Request Info - Mozilla Firefox_201.png

Screenshot-2017-10-13 Modules • ProcessWire • localhost.png

  • Like 1

Share this post


Link to post
Share on other sites

Hi @mel47 - yeah, that's confusing to me too.

I know what's stopping them from being displayed, but still not sure exactly why - I am thinking it might be a Windows path issue at this stage.

Can you please post a screenshot of the Server Request section expanded. If it's easier, just the bottom half of it will be fine, from SERVER_NAME onwards. I am sure it will be a simple fix, but I need to know what some of those values are returning for you.

Thanks!

Share this post


Link to post
Share on other sites

New Search ProcessWire website feature in the ProcessWire Info Panel. 

For updates to old Tracy installs, you will need to manually enable this feature in the module settings. It is on by default in new installs.

Any term you type in the box will take you to a Google site search for the PW website, eg a search for Tracy will take you to the results for a 

site:processwire.com/ tracy

Hopefully you guys find this useful!

59e16a23cfccf_ScreenShot2017-10-13at6_35_19PM.png.6536daf70b738cf98cd95e14b4a68971.png

  • Like 5

Share this post


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

New Search ProcessWire website feature in the ProcessWire Info Panel. 

Nice. How about some radios for more focused searches?

API reference - site:processwire.com/api/
Forums - site:processwire.com/talk/
Blog - site:processwire.com/blog/

I have these as keyword searches in my browser and they get a lot of use. :)
(TBH, it's so easy to Ctrl+L focus the browser address bar and do a keyword search that I'm not likely to give the Tracy feature much use, but maybe some will prefer the Tracy option).

  • Like 3

Share this post


Link to post
Share on other sites
11 hours ago, Robin S said:
12 hours ago, adrian said:

 

Nice. How about some radios for more focused searches?

API reference - site:processwire.com/api/
Forums - site:processwire.com/talk/
Blog - site:processwire.com/blog/

 

Yeah, I was thinking about doing that - just implemented:

59e218eb8fcca_ScreenShot2017-10-14at7_01_57AM.png.58cefbd4ddbcd35ab4701e6cd71fe2ff.png

  • Like 3
  • Thanks 2

Share this post


Link to post
Share on other sites
On 13/10/2017 at 8:44 AM, adrian said:

Hi @mel47 - yeah, that's confusing to me too.

I know what's stopping them from being displayed, but still not sure exactly why - I am thinking it might be a Windows path issue at this stage.

Can you please post a screenshot of the Server Request section expanded. If it's easier, just the bottom half of it will be fine, from SERVER_NAME onwards. I am sure it will be a simple fix, but I need to know what some of those values are returning for you.

Thanks!

Thanks

 

Request Info - Mozilla Firefox_203.png

  • Like 1

Share this post


Link to post
Share on other sites

Thanks @mel47 - that explains it - it's because you are running your site in a subdirectory: /24h/

Could you please confirm that: 

d($urls->root);

in the Tracy Console panel returns: /24h/

Once I know that I'll be able to fix this.

Share this post


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

Thanks @mel47 - that explains it - it's because you are running your site in a subdirectory: /24h/

Could you please confirm that: 


d($urls->root);

in the Tracy Console panel returns: /24h/

Once I know that I'll be able to fix this.

Yes exactly :

"/24h/" (5)
  • Like 1

Share this post


Link to post
Share on other sites

Thanks @mel47 - can you please test the latest version and let me know how it goes for you?

  • Thanks 1

Share this post


Link to post
Share on other sites

Thanks for the efficiency! Come back of my preferred panel! ;-)

  • Like 1

Share this post


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

Thanks for the efficiency! Come back of my preferred panel! ;-)

Good to hear it's working again. I hope that splitting up of that info across the PW Info panel and this new Request Info panel is proving ok for you. As I mentioned above, I wanted to make the relevant info also appear in the AJAX bar, but didn't want doubling up of links to the PW admin and other things that don't change, hence the need for this change.

  • Like 1

Share this post


Link to post
Share on other sites

Just a quick update to let you all know that:

1) With lots of help from @gmclelland we have been ticking off a lot of PHP 7.2 errors. Not sure that we have discovered them all yet though, so please let me know if you come across any.

2) I just forced the Validator panel to use the HTML5 version all the time. I was finding the other version wasn't working for some sites. Hopefully this won't cause any problems, but please let me know if you find anything amiss.

  • Like 4

Share this post


Link to post
Share on other sites

Nice little improvement to the ProcessWire Info panel. I have reduced the admin links section down to some basics: 

  • Admin
  • Login / Logout
  • Clear Session & Cookies
  • Tracy Debugger Settings.

The removed links can now be added as you wish via the "Custom Links" section. This is configurable in the module settings and lets you link to any page in the Page Tree. The two screenshots show the same custom links (with and without labels). 

You'll notice that I have added links to a few Process modules (Upgrades, Changelog, and Cache Admin), along with the links that used to be available by default, and then another link to "Add Page" and also to a plain page (My Special Page). Personally I am just going to remove many of these for my own setup so it's just down to those I use a lot. For example I will definitely delete the "Fields", "Templates", and "Roles" links because I rarely want to go to those parent pages anyway - I always want to go via the admin submenus to go to a specific template or field, etc.

Anyway, hopefully you'll all find this a useful way to add shortcuts to regular admin tools from the frontend of your sites.

59ed311d88771_ScreenShot2017-10-22at11_01_08AM.png.662b0baf07b4cddda508e321379d73ea.png59ed311c02225_ScreenShot2017-10-22at11_02_20AM.thumb.png.4762b07c2bf6b23fe01dd1eb9cc4b74a.png

On a minor technical note, the module settings for these custom links actually converts the page IDs to page paths so that you can use the Module Settings Import Export module to setup Tracy on other sites without having to redefine these links (because page IDs for non admin pages will be different).

  • Like 6

Share this post


Link to post
Share on other sites

If you're think you're going crazy (I did :)) and wondering why you can't uninstall modules on your site, please update Tracy! - the new Request Info panel was the cause.

I also just fixed an issue with the ProcessWire Version Switcher panel. Not sure when it stopped working as expected (I think maybe a PW core change affected it?), but it wasn't doing a final reload after the version was changed which made it look like nothing had happened. This is now fixed and once again makes it possible to change core versions with one click.

  • Like 1

Share this post


Link to post
Share on other sites

Major revamp to Dumps / Dumps Recorder panels

This has bugged me for a while - the Tracy core dumps panel is:

  • ugly and with a forced label whether you want labels for it or not
  • doesn't show a count of dumps next to the icon
  • doesn't show dumps from consecutive ajax calls - each call overwrites the previous dump

That is why I built the original Dumps Recorder panel, but it also had a problem:

  • the redirect and ajax Dumps Recorder panels contained all previous dumps (those from the main page request, etc) which made it hard to see what was from what

So now I have overridden the core Dumps panel with a new version that has:

  • an optional label
  • a count of dumps
  • adds consecutive ajax calls so you don't miss any. 

I have rebuilt the Dumps Recorder panel as well. You probably won't want this most of the time, so it is no longer enabled by default on new Tracy installs, so if you are upgrading, I recommend disabling the Dumps Recorder panel by default and just enabling via the Panel Selector as needed. It no longer has a "Preserve Dumps" option, because that is now it's only purpose, so when it is enabled, it will preserve all dumps across all page / ajax requests and reloads. You can click "Clear Dumps" whenever you want, and of course disabling it will also clear the recorded dumps.

I think this is a major improvement - it keeps things simple when that's all you need, but enables recording when you want to keep track of changes over multiple requests or you simply find that your bd() calls are somehow being lost / not shown - sometimes I see this when debugging modules - the dumps will be stored, but not shown - the dumps recorder will record these and show on the next page reload.

Hope all that makes sense - please try it out and let me know if you find anything that you think can be improved.

One other thing - I have moved the $_SESSION section from the Debug mode panel to the Request Info panel - I think that's a more appropriate location - inline with having the INPUT (post, get, and cookies) in there. On Tracy upgrades, you'll need to enable SESSION in the config settings for the Request Info panel.

  • Like 4
  • Thanks 1

Share this post


Link to post
Share on other sites

Thanks and keep bugging us with such updates :)

  • Like 4

Share this post


Link to post
Share on other sites

Hi @adrian,

What do you think about the idea of adding a filter search to the Captain Hook panel? Much of the time when I use this panel I know the name of the class and method I want to hook and I'm just wanting to check what the arguments are (and it's a handy way to jump to the method in my editor).

Not sure how tricky that would be to implement. Even if it just worked on the top level (the file names) it would be cool.

Share this post


Link to post
Share on other sites

Hello,

today I have activated the Captain Hook Panel in Tracy for the first time and I always get this message:

screenshot-www.juergen-kern.at-2017-10-29-08-56-11.thumb.png.bfa651a7d2260b6bccc94335835c63c4.png

What should I do to prevent this? Where can I define the variable "paths"?

Best regards

Share this post


Link to post
Share on other sites
7 hours ago, Robin S said:

Hi @adrian,

What do you think about the idea of adding a filter search to the Captain Hook panel? Much of the time when I use this panel I know the name of the class and method I want to hook and I'm just wanting to check what the arguments are (and it's a handy way to jump to the method in my editor).

Not sure how tricky that would be to implement. Even if it just worked on the top level (the file names) it would be cool.

Hey Robin - I have thought about it but I have always found that clicking Toggle All and then CTRL/CMD+F to use the browser's "Find" functionality works just fine. I agree that it would be a nice addition though, so I will have a think about it.

 

4 hours ago, Juergen said:

Hello,

today I have activated the Captain Hook Panel in Tracy for the first time and I always get this message:

What should I do to prevent this? Where can I define the variable "paths"?

Best regards

Hey Juergen - I am wondering if maybe you're running PHP 5.3? I think it might be coming from the fact that I directly set $paths[] rather than previously defining $paths = array()

Could you help me out and try adding: 

$paths = array();

on line 32, before the start of the foreach on 33

Please let me know if that works.

Share this post


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

I am running  PHP 7.0.22 :) so "[]" are not the problem.

Well in that case can I please ask if you could check where things are failing. Start with checking if the "if" statement on line 35 ever validates. The maybe the value of $iter before the foreach. Then go back and check $root which is defined in the GenerateHTML.php file.

Thanks for helping with this.

Share this post


Link to post
Share on other sites

Ok, i figured it out. Adding

$paths = array();

before the foreach start solves the problem. So it seems that if $path is not defined as an array before the foreach, it doesnt work. So the complete code is like this:

        $paths = array();//this solves the problem
        foreach ($iter as $path => $dir) {
            // '/.' check is for site module backups - SKIP_DOTS above is not excluding these
            if (!$dir->isDir() && strpos($path, '/.') === false && preg_match($fileNamePattern, $path) && !in_array(basename($path), $excludeFilenames) ) {
                $paths[] = $path;
            }
        }

        return $paths;

Best regards

 

  • Like 1

Share this post


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

Ok, i figured it out. Adding


$paths = array();

before the foreach start solves the problem.

Thanks - that is what I thought. Weird though that it's not causing problems for anyone else :)

I'll push an update in a minute.

  • 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
      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.

       
      https://github.com/Toutouwai/PagesAtBottom
      https://modules.processwire.com/modules/pages-at-bottom/
      Coming soon: sort bottom pages in Page List according to their sort order in the module config.
    • 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.