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   1 member

  • Similar Content

    • 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://gitlab.com/baumrock/RockFinder/tree/master
       
      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/
    • By OLSA
      Hello for all,
      ConfigurationForm fieldtype module is one my experiment from 2016.
      Main target to build this module was to store multiple setup and configuration values in just 1 field and avoid to use 1 db table to store just single "number of items on page", or another db table to store "layout type" etc. Thanks to JSON formatted storage this module can help you to reduce number of PW native fields in project, save DB space, and reduce number of queries at front-end.
      Install and setup:
      Download (at the bottom ), unzip and install like any other PW module (site/modules/...). Create some filed using this type of field (ConfigurationForm Fieldtype) Go to field setup Input tab and drag some subfields to container area (demo). Set "Name" and other params for subfields Save and place field to templates ("Action tab") How to use it:
      In my case, I use it to store setup and configurations values, but also for contact details, small content blocks... (eg. "widgets").
      Basic usage example:
      ConfigForm fieldtype "setup" has subfields:
      "limit", type select, option values: 5, 10, 15, 20
      "sort", type select, option values: "-date", "date",  "-sort", "sort"
      // get page children (items) $limit = isset($page->setup->limit) ? $page->setup->limit : 10; $sort = isset($page->setup->sort) ? $page->setup->sort : '-sort'; $items = $page->children("limit=$limit, sort=$sort");  
      Screenshots:


       
      Notes:
      Provide option to search inside subfields Provide multilanguage inputs for text and textarea field types Provide option for different field layout per-template basis Do not place/use field type "Button" or "File input" because it won't works. Please read README file for more details and examples Module use JSON format to store values. Text and textarea field types are multilanguage compatible, but please note that main target for this module was to store setup values and small content blocks and save DB space. Search part inside JSON is still a relatively new in MySQL (>=5.77) and that's on you how and for what to use this module.
      Thanks:
      Initial point for this fieldtype was jQuery plugin FormBuiled and thanks to Kevin Chappel for this plugin.
      In field type "link" I use javascript part from @marcostoll module and thanks to him for that part.
      Download:
      FieldtypeConfigForm.zip
      Edit: 14. August 2018. please delete/uninstall previously downloaded zip
      Regards.
         
    • 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://gitlab.com/baumrock/RockPdf
       
      You can combine it easily with RockReplacer: 
      See also a little showcase of the RockPdf module in this thread:
       
    • By Thomas Diroll
      Hi guys I'm relatively new to PW and just finished developing a page for a client. I was able to include all necessary functionality using the core fieldtypes but now I it seems that I need to extend them with a custom one. What I need is a simple button, that copies the absolute url (frontend not PW-backend) of the page which is currently edited to the clipboard. As this feature is only needed inside a specific template, I tend to use a custom fieldtype which provides this feature. I've been looking inside the core modules code (eg. FieldtypeCheckbox.module) but I don't really get the structure of it and how its rendered to the admin page. I also didn't find a lot of tutorials covering custom fieldtypes.
      Maybe some of you could give me some tips on how to write a basic custom fieldtype that renders a button which copies the value of
      page->httpUrl() to the clipboard using JS. Thanks!
    • By bernhard
      Some of you might have followed the development of this module here: https://processwire.com/talk/topic/15524-previewdiscussion-rockdatatables/ . It is the successor of "RockDataTables" and requires RockFinder to get the data for the grid easily and efficiently. It uses the open source part of agGrid for grid rendering.
       
      WHY?
      ProcessWire is awesome for creating all kinds of custom backend applications, but where it is not so awesome in my opinion is when it comes to listing this data. Of course we have the built in page lister and we have ListerPro, but none of that solutions is capable of properly displaying large amounts of data, for example lists of revenues, aggregations, quick and easy sorts by the user, instant filter and those kind of features. RockGrid to the rescue 😉 
       
      Features/Highlights:
      100k+ rows Instant (client side) filter, search, sort (different sort based on data type, eg "lower/greater than" for numbers, "contains" for strings) extendable via plugins (available plugins at the moment: fullscreen, csv export, reload, batch-processing of data, column sum/statistics, row selection) all the agGrid features (cell renderers, cell styling, pagination, column grouping etc) vanilla javascript, backend and frontend support (though not all plugins are working on the frontend yet and I don't plan to support it as long as I don't need it myself)  
      Limitations:
      While there is an option to retrieve data via AJAX the actual processing of the grid (displaying, filtering, sorting) is done on the client side, meaning that you can get into troubles when handling really large datasets of several thousands of rows. agGrid should be one of the most performant grid options in the world (see the official example page with a 100k row example) and does a lot to prevent problems (such as virtual row rendering), but you should always have this limitation in mind as this is a major difference to the available lister options that do not have this limitation.
      Currently it only supports AdminThemeUikit and I don't plan to support any other admin theme.
       
      Download: https://gitlab.com/baumrock/RockGrid
      Installation: https://gitlab.com/baumrock/RockGrid/wikis/Installation
      Quikckstart: https://gitlab.com/baumrock/RockGrid/wikis/quickstart
      Further instructions: https://gitlab.com/baumrock/RockGrid/wikis/quickstart#further-instructions
       
      Module status: alpha, License: MIT
      Note that every installation and uninstallation sends an anonymous google analytics event to my google analytics account. If you don't want that feel free to remove the appropriate lines of code before installation/uninstallation.
       
      Contribute:
      You can contribute to the development of this and other modules or just say thank you by
      testing, reporting issues and making PRs at gitlab liking this post buying me a drink: paypal.me/baumrock/5 liking my facebook page: facebook.com/baumrock hiring me for pw work: baumrock.com  
      Support: Please note that this module might not be as easy and plug&play as many other modules. It needs a good understanding of agGrid (and JavaScript in general) and it likely needs some looks into the code to get all the options. Please understand that I can not provide free support for every request here in the forum. I try to answer all questions that might also help others or that might improve the module but for individual requests I offer paid support for 60€ per hour.
       
      Changelog
      180730 support subdir installations 180711 bugfix (naming issue) 180630 alpha realease  
      Use Cases / Examples:
      Colored grid cells, Icons, Links etc. The Grid also has a "batcher" feature built in that helps communicating with the server via AJAX and managing resource intensive tasks in batches:

      Filters, PW panel links and instant reload on panel close:

      You can combine the grid with a chart library like I did with the (outdated) RockDataTables module: