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 BitPoet
      MediaLibrary
      Update: MediaLibrary can now be found in the official module list.
      Out of necessity, I've started to implement a simple media library module.
      The basic mechanism is that it adds a MediaLibrary template with file and image fields. Pages of this type can be added anywhere in the page tree.
      The link and image pickers in CKEditor are extended to allow quick selection of library pages from dropdowns. In the link picker this happens in the MediaLibrary tab, where you can also see a preview of the selected image. In the image picker, simply select a library from the dropdown at the top, everything else is handled by standard functionality.
      I've put the code onto github. This module is compatible with ProcessWire 3.
      Steps to usage:
      Download the module's zip from github (switch to the pw3 branche beforehand if you want to test on PW 3.x) and unpack it into site/modules Click "Modules" -> "Refresh" in the admin Click "Install" for MediaLibrary For testing, create a page with the MediaLibrary template under home (give it an expressive title like 'Global Media') and add some images and files Edit a differnt page with a CKEditor field and add a link and an image to see the MediaLibrary features in action (see the screencap for details) Optionally, go into the module settings for MediaLibrary Note: this module is far from being as elaborate as Kongondo's Media Manager (and doesn't plan to be). If you need a feature-rich solution for integrated media management, give it a look.
      Feel free to change the settings for MediaFiles and MediaImages fields, just keep the type as multiple.
      There are some not-so-pretty hacks for creating and inserting the correct markup, which could probably be changed to use standard input fields, though I'm a bit at a loss right now how to get it to work. I've also still got to take a look at error handling before I can call it fit for production. All feedback and pointers are appreciated (that's also why I post this in the development section).

      Edit 09.03.2016 / version 0.0.4: there's now also a "Media" admin page with a shortcut to quickly add a new library.

      Edit 01.05.2016:
      Version 0.0.8:
      - The module now supports nested media libraries (all descendants of eligible media libraries are also selectable in link/image picker).
      - There's a MediaLibrary::getPageMediaLibraries method you can hook after to modify the array of available libraries.
      - You can switch between (default) select dropdowns or radio boxes in the module configuration of MediaLIbrary to choose libraries.
      Edit 10.10.2018:
      Version 0.1.3:
      - Dropped compatibility for ProcessWire legacy versions by adding namespaces
      - Allow deletion of libraries from the Media overview admin page
      - Added an option to hide media libraries from the page tree (optionally also for superusers)
    • By Robin S
      This module corrects a few things that I find awkward about the "Add New Template" workflow in the PW admin. I opened a wishlist topic a while back because it would good to resolve some of these things in the core, but this module is a stopgap for now.
      Originally I was going to share these as a few standalone hooks, but decided to bundle them together in a configurable module instead.
      Add Template Enhancements
      A module for ProcessWire CMS/CMF. Adds some efficiency enhancements when adding or cloning templates via admin.

      Features
      Derive label from name when new template added: if you like to give each of your templates a label then this feature can save some time. The label can be added automatically when templates are added in admin, in admin/API, or not at all. There are options for underscore/hyphen replacement and capitalisation of the label. Edit template after add: when adding only a single template, the template is automatically opened for editing after it is added. Copy field contexts when cloning: this copies the field contexts (a.k.a. overrides such as column width, label and description) from the source template to the new template when using the "Duplicate/clone this template?" feature on the Advanced tab. Copy field contexts when duplicating fields: this copies the field contexts if you select the "Duplicate fields used by another template" option when adding a new template. Usage
      Install the Add Template Enhancements module.
      Configure the module settings according to what suits you.
       
      https://github.com/Toutouwai/AddTemplateEnhancements
      https://modules.processwire.com/modules/add-template-enhancements/
    • By Mike Rockett
      As I mentioned in this issue, I've create a new textformatter for ParsedownExtraPlugin, which adds some oomph to your markdown.
      Repo: Parsedown Extra Plugin
      Unlike the built-in textformatter for Parsedown and Parsedown Extra, this should be used when you want to use Extra with additional configuration/customisation.
      Some examples:
      ### Test {.heading} - A [external link](https://google.com/){.google} with `google` as a class that opens in a new tab if the config property is set. - [Another link](/page){target=_blank} that opens in a new tab even though it isn't external. ```html .html <p>Test</p> ``` There's some config options available to you, such as setting attributes on all/external images and links, setting table and table-cell alignment classes, adjusting footnote classes and IDs, adding <code> attributes to their parent <pre> elements, and changing the <code> class if your syntax highlighter does not use language-*.
      I was thinking about adding the ability to make links open in a new tab by appending a plus to the link syntax, but only external links should be opening in a new tab anyway. Further, this would add extra, unnecessary processing time.
      Please let me know if you bump into any problems. ☺️
    • By Mike Rockett
      TextformatterTypographer (0.4.0 Beta)
      A ProcessWire wrapper for the awesome PHP Typography class, originally authored by KINGdesk LLC and enhanced by Peter Putzer in wp-Typography. Like Smartypants, it supercharges text fields with enhanced typography and typesetting, such as smart quotations, hyphenation in 59 languages, ellipses, copyright-, trade-, and service-marks, math symbols, and more.
      Learn more on my blog
      It's based on the PHP-Typography library found over at wp-Typography, which is more frequently updated and feature rich that its original by KINGdesk LLC.
      The module itself is fully configurable. I haven't done extensive testing, but there is nothing complex about this, and so I only envisage a typographical bug here and there, if any.
      Please do test it out and let me know what you think.
      Also note that I have indicated support for PW 2.8, but I haven't tested there as yet. This was built on PW 3.0.42/62.
    • By Mike Rockett
      Jumplinks for ProcessWire
      Release: 1.5.50
      Jumplinks is an enhanced version of the original ProcessRedirects by Antti Peisa.
      The Process module manages your permanent and temporary redirects (we'll call these "jumplinks" from now on, unless in reference to redirects from another module), useful for when you're migrating over to ProcessWire from another system/platform. Each jumplink supports wildcards, shortening the time needed to create them.
      Unlike similar modules for other platforms, wildcards in Jumplinks are much easier to work with, as Regular Expressions are not fully exposed. Instead, parameters wrapped in curly braces are used - these are described in the documentation.
      Under Development: 2.0, to be powered by FastRoute
      As of version 1.5.0, Jumplinks requires at least ProcessWire 2.6.1 to run.
      View on GitLab
      Download via the Modules Directory
      Read the docs
      Features
      The most prominent features include:
      Basic jumplinks (from one fixed route to another) Parameter-based wildcards with "Smart" equivalents Mapping Collections (for converting ID-based routes to their named-equivalents without the need to create multiple jumplinks) Destination Selectors (for finding and redirecting to pages containing legacy location information) Timed Activation (activate and/or deactivate jumplinks at specific times) 404-Monitor (for creating jumplinks based on 404 hits) Additionally, the following features may come in handy:
      Stale jumplink management Legacy domain support for slow migrations An importer (from CSV or ProcessRedirects) Feedback & Feature Requests
      I’d love to know what you think of this module. Please provide some feedback on the module as a whole, or even regarding smaller things that make it whole. Also, please feel free to submit feature requests and their use-cases.
      Note: Features requested so far have been added to the to-do list, and will be added to 2.0, and not the current dev/master branches.
      Open Source

      Jumplinks is an open-source project, and is free to use. In fact, Jumplinks will always be open-source, and will always remain free to use. Forever. If you would like to support the development of Jumplinks, please consider making a small donation via PayPal.
      Enjoy!