Jump to content
adrian

Tracy Debugger

Recommended Posts

Just now, matjazp said:

Just wanted to upgrade her, but I got compile error: "Cannot declare class TracyDebugger, because the name is already in use", File: ...\modules\TracyDebugger\TracyDebugger.module.php:24  

I was worried that might happen. @bernhard added .php to the TracyDebugger.module file so that intellisense in vscode could work its magic. I thought I might starting adding the php extension to all my modules files because .module really is a silly extension in my mind. 

You'll be able to solve the issue my deleting the .module version. Same goes for ProcessTracyAdminer.module.

I am curious what method you used to upgrade. I would have thought that the PW Upgrades module would handle this and a git update approach should also work. Updating via modules > add new should also work. Did you just unzip and copy?

  • Like 1

Share this post


Link to post
Share on other sites

I used PW upgrades module...

Edit: Adminer 4.7.0 (released 2018-11-24)

  • Like 1

Share this post


Link to post
Share on other sites
2 minutes ago, matjazp said:

I used PW upgrades module...

Edit: Adminer 4.7.0 (released 2018-11-24)

Weird - I just tested upgrading Tracy with the PW Upgrades module and it deleted the old .module versions automatically. I have no idea why it wouldn't have worked the same for you.

Thanks for the Adminer update note.

Share this post


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

Well it took several hours of discussions with @bernhard and lots of back and forwards on the best way to do things, but we've finally committed the "WebHooks" panel he posted about above.

Awesome work @bernhard and @adrian. Hopefully one day I'll get to test all these wonderful stuff being added. That might be a while, given that it's only today that I discovered the Tracy console can be opened in a new window! 😁

  • Like 2

Share this post


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

I discovered the Tracy console can be opened in a new window!

Interesting because I actually purposely made this not obvious by hiding the icon that triggers the new window mode. Are you using SHIFT+Click to trigger this or is the icon not hidden for you?

The reason I "disabled" this functionality is that it was a bit painful to get layout to work properly in this mode. And actually, the Console panel is completely broken for me at the moment in this mode at the moment. Are you running a much older version?

Share this post


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

Are you using SHIFT+Click to trigger this or is the icon not hidden for you?

I'm using the icon; it's not hidden for me.

37 minutes ago, adrian said:

Are you running a much older version?

On this machine I'm running 4.8.24

38 minutes ago, adrian said:

Interesting because I actually purposely made this not obvious by hiding the icon that triggers the new window mode.

The new window came handy today. I needed to see different windows at the same time and docked, the console was in the way, plus I just couldn't make it bigger. I've done it before, but can't remember how :-).

  • Like 1

Share this post


Link to post
Share on other sites
58 minutes ago, kongondo said:

On this machine I'm running 4.8.24

That's ancient (10 months old) - you are missing out on so much 🙂 but that explains why the icon is not hidden.

58 minutes ago, kongondo said:

I just couldn't make it bigger. I've done it before, but can't remember how :-).

There are lots of new options for making the Console panel larger - you can maximize the panel, but you can also fullscreen mode the editor/results panes.

You can also "rollup" any Tracy panels by double-clicking on their title bar - nice to get it out of the way quickly.

I'll see about restoring the "window" option, but no promises - it's been painful!

 

Share this post


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

Edit: Adminer 4.7.0 (released 2018-11-24)

New version of Tracy includes 4.7.0

  • Like 3

Share this post


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

Weird - I just tested upgrading Tracy with the PW Upgrades module and it deleted the old .module versions automatically. I have no idea why it wouldn't have worked the same for you.

I experienced the same issue using the PW Upgrades module. I think it is Windows-specific and relates to a bug introduced by Ryan trying to resolve this issue: https://github.com/processwire/processwire-issues/issues/704
In recent dev versions PW is not able to delete files on Windows. See also: 

 

  • Like 3

Share this post


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

That's ancient (10 months old) - you are missing out on so much 🙂 but that explains why the icon is not hidden.

In fact I misspoke in my previous post. I've been using the new version but on a different local site. On the site I'm currently on, I have the older Tracy :-). 

52 minutes ago, adrian said:

There are lots of new options for making the Console panel larger

Yeah; now I seem to remember this. It was of course on the other site where I had the new Tracy. I even played around with Adminer, I recall. 

52 minutes ago, adrian said:

You can also "rollup" any Tracy panels by double-clicking on their title bar - nice to get it out of the way quickly.

Good to know, thanks.

  • Like 1

Share this post


Link to post
Share on other sites
5 minutes ago, kongondo said:
55 minutes ago, adrian said:

 

In fact I misspoke in my previous post. I've been using the new version but on a different local site

Does this mean you are seeing the "open in window" icon on the new version? It should look like this:

image.png.3fedeb8ea66afdad58a54df8e97b6baa.png

Just the Maximize/Restore icon and the close icon.

The open in window icon should be hid by this rule:

https://github.com/adrianbj/TracyDebugger/blob/077b5c26aea42de451dcd94d97ae186d3bbf8529/styles.css#L830-L833

Share this post


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

Does this mean you are seeing the "open in window" icon on the new version? It should look like this:

No. It means I'm using different versions of Tracy on different sites (multisite) on the same machine 😃.

 

Edit: Maybe this old version is why Tracy is not appearing in modal windows or that has always been the case?

Edited by kongondo
  • Like 1

Share this post


Link to post
Share on other sites

Adrian please save your time and forget about the open in new window stuff. The new options are much better!

Share this post


Link to post
Share on other sites

A couple of updates to the new RequestLogger panel.

You can now define which types of request methods are logged: GET, POST, PUT, DELETE, PATCH. By default, all are checked, but I think in most cases unchecking GET is probably helpful as it will prevent page views from being logged.

image.png.acef35a02d410f2d818bab775bdfe240.png

You can now use this panel on non-ProcessWire pages, so if you use a php script like payment_confirmation.php in the root of your site, so long as it bootstraps PW (include ./index.php), it will let you log and retrieve request data. The only catch is that you need to trigger the logging manually by adding:

$page->logRequests();

to the script file. 

Visit the page and enable logging (as with any normal PW page) and you're good to go.

The only weird thing at the moment with this is that the logged url will be /http404/ but otherwise it works as expected.

Let me know if you make use of this approach and if you find any issues.

BTW, I still need to add docs for the Request Logger, API Explorer, and Adminer panels to https://adrianbj.github.io/TracyDebugger/ - I've been slack on this. Anyone out there like doing documentation and would like to help 🙂

  • Like 2

Share this post


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

BTW, I still need to add docs for the Request Logger, API Explorer, and Adminer panels to https://adrianbj.github.io/TracyDebugger/ - I've been slack on this. Anyone out there like doing documentation and would like to help 🙂

I could maybe do that for RequestLogger over christmas...

  • Like 2

Share this post


Link to post
Share on other sites

Hello to all,

I've just tried updating the module and got an error. I then deleted it completely to start all over again (on my local site), and as soon as it is downloaded, even if I choose to leave it uninstalled, I still have the same fatal error (I must delete the TracyDebugger folder in my modules completely to be able to access my site). Here's the error :

	require_once(): Failed opening required '/home/celfred/PlanetAlert/site/modules/TracyDebugger/panels/TemplateEditorPanel.php' (include_path='.:/usr/share/php')
	

And I'm sorry to say I have no idea what to do... So if one of you could give me a hint, that would be great. I was using TracyDebugger more and more (for minor debugging, I guess you can tell from my question) but I would like to use it more 🙂 

Share this post


Link to post
Share on other sites

@celfred - does that file actually exist?

How are you upgrading / installing Tracy ? It's always safest through Setup > Modules > New or the PW Upgrades module.

Also, if it's uninstalled and you're getting that error, then you probably need to do a Modules > Refresh

Share this post


Link to post
Share on other sites

@adrian : Well, I am upgrading through Setup > Modules > New and I type the className. Everything downloads and then I click 'Install now'.

I've checked the path and no, the file doesn't exist.

I've tried the Modules > Refresh and re-installed Tracydebugger : same problem. Here's the line mentionned that triggers the issue :

	File: .../modules/TracyDebugger/TracyDebugger.module.php:1341
	

Thanks for your quick reply.

Edit : I've checked on Github in panels folder, and there is no TemplateEditorPanel.php file... I really don't get it...

Share this post


Link to post
Share on other sites
58 minutes ago, celfred said:

@adrian : Well, I am upgrading through Setup > Modules > New and I type the className. Everything downloads and then I click 'Install now'.

I've checked the path and no, the file doesn't exist.

I've tried the Modules > Refresh and re-installed Tracydebugger : same problem. Here's the line mentionned that triggers the issue :


	File: .../modules/TracyDebugger/TracyDebugger.module.php:1341
	

Thanks for your quick reply.

Edit : I've checked on Github in panels folder, and there is no TemplateEditorPanel.php file... I really don't get it...

Oh now I see what's going on - the Template Editor panel hasn't existed in forever 🙂 Your module settings must be configured to try to load it still. An uninstall/reinstall should remove those settings though. Maybe you had used the Panel Selector and "Sticky" selected the template editor? Could you please delete the "tracyPanelsSticky" cookie from your browser and let me know if that works.

Share this post


Link to post
Share on other sites

@celfred - I just committed a new version that won't error even if there are old settings with panels that no longer exist, so please try updating and let me know how you go.

Share this post


Link to post
Share on other sites

@adrian I was indeed about to tell you I'm updating from... 3.6.9 ! I managed to get back the old version from my remote site).

So far, I've tried what you said :

  • Starting with a 'regular' update trhough the module page, clicking on update. It detects the 4?15.4 version. It downloads and then still triggers the same error.
  • Then, I went to check the cookies. I couldn't find the TracyPanelSticky you mentionned, but trying to erase all Tracy cookies (and eventually deleting all my localhost cookies), and also deleting the TracyDebugger folder in my modules folder, and deleting the TracyDebugger folder in my assets/cache/Filecompiler/site/modules... still the same result 😞 In short, I have deleted all traces I could find of TracyDebugger and tried re-installing 4.15.4 but the error persists.

You were perfectly right about the 'sticky panel' : I remember I had the var-dump panel sticky before updating.

Thanks a lot for your help.

Share this post


Link to post
Share on other sites

@celfred - sorry, looks like I forgot to commit that new 4.15.5 version - please try updating now - this new version should prevent the error.

  • Thanks 1

Share this post


Link to post
Share on other sites

I updated PW from 3.0.111 to 3.0.121 today.

I've got a compile error when I wanted to update Tracy as well:

File: .../modules/TracyDebugger/TracyDebugger.module.php:24
class TracyDebugger extends \ProcessWire\WireData implements \ProcessWire\Module, \ProcessWire\ConfigurableModule {

https://dev.foo.com/backstage/module/download/
PHP 7.2.12
Apache/2.4
Tracy 2.5-dev


tracy-error-exception.png.57db11b8bec6e4550f99abe95a2c662a.png

Edited by dragan
added screenshot

Share this post


Link to post
Share on other sites

Hi @dragan - does a Modules > Refresh take care of things for you?

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 Gadgetto
      SnipWire - Snipcart integration for ProcessWire
      Snipcart is a powerful 3rd party, developer-first HTML/JavaScript shopping cart platform. SnipWire is the missing link between Snipcart and the content management framework ProcessWire.
      With SnipWire, you can quickly turn any ProcessWire site into a Snipcart online shop. The SnipWire plugin helps you to get your store up and running in no time. Detailed knowledge of the Snipcart system is not required.
      SnipWire is free and open source licensed under Mozilla Public License 2.0! A lot of work and effort has gone into development. It would be nice if you could donate an amount to support further development:

      Status update links (inside this thread) for SnipWire development
      2020-07-03 -- SnipWire 0.8.7 (beta) released! Fixes some small bugs and adds an indicator for TEST mode 2020-04-06 -- SnipWire 0.8.6 (beta) released! Adds support for Snipcart subscriptions and also fixes some problems 2020-03-21 -- SnipWire 0.8.5 (beta) released! Improves SnipWires webhooks interface and provides some other fixes and additions 2020-03-03 -- SnipWire 0.8.4 (beta) released! Improves compatibility for Windows based Systems. 2020-03-01 -- SnipWire 0.8.3 (beta) released! The installation and uninstallation process has been heavily revised. 2020-02-08 -- SnipWire 0.8.2 (beta) released! Added a feature to change the cart and catalogue currency by GET, POST or SESSION param 2020-02-03 -- SnipWire 0.8.1 (beta) released! All custom classes moved into their own namespaces. 2020-02-01 -- SnipWire is now available via ProcessWire's module directory! 2020-01-30 -- SnipWire 0.8.0 (beta) first public release! (module just submitted to the PW modules directory) 2020-01-28 -- added Custom Order Fields feature (first SnipWire release version is near!) 2020-01-21 -- Snipcart v3 - when will the new cart system be implemented? 2020-01-19 -- integrated taxes provider finished (+ very flexible shipping taxes handling) 2020-01-14 -- new date range picker, discount editor, order notifiactions, order statuses, and more ... 2019-11-15 -- orders filter, order details, download + resend invoices, refunds 2019-10-18 -- list filters, REST API improvements, new docs platform, and more ... 2019-08-08 -- dashboard interface, currency selector, managing Orders, Customers and Products, Added a WireTabs, refinded caching behavior 2019-06-15 -- taxes provider, shop templates update, multiCURL implementation, and more ... 2019-06-02 -- FieldtypeSnipWireTaxSelector 2019-05-25 -- SnipWire will be free and open source Plugin Key Features
      Fast and simple store setup Full integration of the Snipcart dashboard into the ProcessWire backend (no need to leave the ProcessWire admin area) Browse and manage orders, customers, discounts, abandoned carts, and more Multi currency support Custom order and cart fields Process refunds and send customer notifications from within the ProcessWire backend Process Abandoned Carts + sending messages to customers from within the ProcessWire backend Complete Snipcart webhooks integration (all events are hookable via ProcessWire hooks) Integrated taxes provider (which is more flexible then Snipcart own provider) Useful Links
      SnipWire in PW modules directory SnipWire Docs (please note that the documentation is a work in progress) SnipWire @GitHub (feature requests and suggestions for improvement are welcome - I also accept pull requests) Snipcart Website  

       
      ---- INITIAL POST FROM 2019-05-25 ----
       
    • By Sten
      Hello
      Till now I hacked something with the twig template but it works no more with new PW versions so I look forward to create a module. I am working on a site in multiple languages : French, English, Italian, German, Spanish, Portuguese, Hebrew, Russian. The new posts are entered in any language with a field for language. Till now, I got twig files to get the translations with constants defined for each part of the pages.
      So I'd like to create a module to include theses files added according to the url /fr/en/...
      Have you some observations to do before I begin about the direction to take ?
      Thank you
    • By ukyo
      Mystique Module for ProcessWire CMS/CMF
      Github repo : https://github.com/trk/Mystique
      Mystique module allow you to create dynamic fields and store dynamic fields data on database by using a config file.
      Requirements
      ProcessWire 3.0 or newer PHP 7.0 or newer FieldtypeMystique InputfieldMystique Installation
      Install the module from the modules directory:
      Via Composer:
      composer require trk/mystique Via git clone:
      cd your-processwire-project-folder/ cd site/modules/ git clone https://github.com/trk/Mystique.git Module in live reaction with your Mystique config file
      This mean if you remove a field from your config file, field will be removed from edit screen. As you see on youtube video.
      Using Mystique with your module or use different configs path, autoload need to be true for modules
      Default configs path is site/templates/configs/, and your config file name need to start with Mystique. and need to end with .php extension.
      Adding custom path not supporting anymore !
      // Add your custom path inside your module class`init` function, didn't tested outside public function init() { $path = __DIR__ . DIRECTORY_SEPARATOR . 'configs' . DIRECTORY_SEPARATOR; Mystique::add($path); } Mystique module will search site/modules/**/configs/Mystique.*.php and site/templates/Mystique.*.php paths for Mystique config files.
      All config files need to return a PHP ARRAY like examples.
      Usage almost same with ProcessWire Inputfield Api, only difference is set and showIf usage like on example.
      <?php namespace ProcessWire; /** * Resource : testing-mystique */ return [ 'title' => __('Testing Mystique'), 'fields' => [ 'text_field' => [ 'label' => __('You can use short named types'), 'description' => __('In file showIf working like example'), 'notes' => __('Also you can use $input->set() method'), 'type' => 'text', 'showIf' => [ 'another_text' => "=''" ], 'set' => [ 'showCount' => InputfieldText::showCountChars, 'maxlength' => 255 ], 'attr' => [ 'attr-foo' => 'bar', 'attr-bar' => 'foo' ] ], 'another_text' => [ 'label' => __('Another text field (default type is text)') ] ] ]; Example:
      site/templates/configs/Mystique.seo-fields.php <?php namespace ProcessWire; /** * Resource : seo-fields */ return [ 'title' => __('Seo fields'), 'fields' => [ 'window_title' => [ 'label' => __('Window title'), 'type' => Mystique::TEXT, // or InputfieldText 'useLanguages' => true, 'attr' => [ 'placeholder' => __('Enter a window title') ] ], 'navigation_title' => [ 'label' => __('Navigation title'), 'type' => Mystique::TEXT, // or InputfieldText 'useLanguages' => true, 'showIf' => [ 'window_title' => "!=''" ], 'attr' => [ 'placeholder' => __('Enter a navigation title') ] ], 'description' => [ 'label' => __('Description for search engines'), 'type' => Mystique::TEXTAREA, 'useLanguages' => true ], 'page_tpye' => [ 'label' => __('Type'), 'type' => Mystique::SELECT, 'options' => [ 'basic' => __('Basic page'), 'gallery' => __('Gallery'), 'blog' => __('Blog') ] ], 'show_on_nav' => [ 'label' => __('Display this page on navigation'), 'type' => Mystique::CHECKBOX ] ] ]; Searching data on Mystique field is limited. Because, Mystique saving data to database in json format. When you make search for Mystique field, operator not important. Operator will be changed with %= operator.
      Search example
      $navigationPages = pages()->find('my_mystique_field.show_on_nav=1'); $navigationPages = pages()->find('my_mystique_field.page_tpye=gallery');
    • By Robin S
      This is a module I made as an experiment a while ago and never got around to releasing publicly. At the time it was prompted by discussions around using Repeater fields for "page builder" purposes, where the depth feature could possibly be used for elements that would be nested inside other elements. I thought it would be useful to enforce some depth rules and translate the depth data into a multi-dimensional array structure.
      I'm not using this module anywhere myself but maybe it's useful to somebody.
      Repeater Depth Helper
      This module does two things relating to Repeater fields that have the "Item depth" option enabled:
      It enforces some depth rules for Repeater fields on save. Those rules are:
      The first item must have a depth of zero. Each item depth must not be more than one greater than previous item depth. It provides a RepeaterPageArray::getDepthStructure helper method that returns a nested depth structure for a Repeater field value.
      Helper method
      The module adds a RepeaterPageArray::getDepthStructure method that returns a multi-dimensional array where the key is the page ID and the value is an array of nested "child" items, or null if there are no nested children.
      Example

      The module doesn't make any assumptions about how you might want to use the depth structure array, but here is a way you might use it to output a nested unordered list.
      // Output a nested unordered list from a depth structure array function outputNestedList($depth_structure, $repeater_items) { $out = "<ul>"; foreach($depth_structure as $page_id => $nested_children) { $out .= "<li>" . $repeater_items->get("id=$page_id")->title; // Go recursive if there are nested children if(is_array($nested_children)) $out .= outputNestedList($nested_children, $repeater_items); $out .= "</li>"; } $out .= "</ul>"; return $out; } $repeater_items = $page->my_repeater; $depth_structure = $repeater_items->getDepthStructure(); echo outputNestedList($depth_structure, $repeater_items);
       
      https://github.com/Toutouwai/RepeaterDepthHelper
      https://modules.processwire.com/modules/repeater-depth-helper/
    • By MoritzLost
      Cacheable Placeholders
      This module allows you to have pieces of dynamic content inside cached output. This aims to solve the common problem of having a mostly cacheable site, but with pieces of dynamic output here and there.  Consider this simple example, where you want to output a custom greeting to the current user:
      <h1>Good morning, <?= ucfirst($user->name) ?></h1> This snippet means you can't use the template cache (at least for logged-in users), because each user has a different name. Even if 99% of your output is static, you can only cache the pieces that you know won't include this personal greeting. A more common example would be CSRF tokens for HTML forms - those need to be unique by definition, so you can't cache the form wholesale.
      This module solves this problem by introducing cacheable placeholders - small placeholder tokens that get replaced during every request. The replacement is done inside a Page::render hook so it runs during every request, even if the response is served from the template cache. So you can use something like this:
      <h1>Good morning, {{{greeting}}}</h1> Replacement tokens are defined with a callback function that produces the appropriate output and added to the module through a simple hook:
      // site/ready.php wire()->addHookAfter('CachePlaceholders::getTokens', function (HookEvent $e) { $tokens = $e->return; $tokens['greeting'] = [ 'callback' => function (array $tokenData) { return ucfirst(wire('user')->name); } ]; $e->return = $tokens; }); Tokens can also include parameters that are parsed and passed to the callback function. There are more fully annotated examples and step-by-step instructions in the README on Github!
      Features
      A simple and fast token parser that calls the appropriate callback and runs automatically. Tokens may include multiple named or positional parameters, as well as multi-value parameters. A manual mode that allows you to replace tokens in custom pieces of cached content (useful if you're using the $cache API). Some built-in tokens for common use-cases: CSRF-Tokens, replacing values from superglobals and producing random hexadecimal strings. The token format is completely customizable, all delimiters can be changed to avoid collisions with existing tag parsers or template languages. Links
      Github Repository & documentation Module directory If you are interested in learning more, the README is very extensive, with more usage examples, code samples and usage instructions!
×
×
  • Create New...