Jump to content

Tracy Debugger


adrian

Recommended Posts

@Peter Knight - the issue is that since you last upgraded, I added a .php extension to the .module file and ProcessWire doesn't like this because its caching system is remembering the old version. I have seen this many times and it's never prevented access to the admin, so never worried about it too much.

You could remove the TracyDebugger folder from site/modules and see if that lets the admin load. You could clear the site/assets/cache/FileCompiler folder. You could remove the TracyDebugger entry from the modules DB table. 

One or all of those should / might work ?

Link to comment
Share on other sites

Howdy @adrian,

I created two custom image fields, both type integer. This image field has two images while the other field is empty. I do not get this error when running stand alone adminer. I have deleted and recreated this field with the same results. Any ideas why this error only shows for this custom field and not the other?

custom-field.thumb.jpg.13f666be829dfee0ad62f7f263e5cc2c.jpg

Thanks for your help!

Link to comment
Share on other sites

Hi @rick - based on the error, it looks like your setup doesn't have the mb_strlen available and I am using the AdminerJsonPreview plugin in Tracy's Adminer setup.

If you install mbstring for php it will be fine. Something like this, depending on your flavor of linux:

sudo apt install php7.x-mbstring

 

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

Hello,

on one of my installs the editor window in the Console in the backend doesn't show up and I get this error in the JS debug console:
 

Uncaught SyntaxError: invalid escape sequence
    evalScripts .../admin/module/edit?name=TracyDebugger&collapse_info=1&_tracy_bar=js&v=2.5.9&XDEBUG_SESSION_STOP=1:514
    forEach .../admin/module/edit?name=TracyDebugger&collapse_info=1&_tracy_bar=js&v=2.5.9&XDEBUG_SESSION_STOP=1:665
    evalScripts .../admin/module/edit?name=TracyDebugger&collapse_info=1&_tracy_bar=js&v=2.5.9&XDEBUG_SESSION_STOP=1:508
    init .../admin/module/edit?name=TracyDebugger&collapse_info=1&_tracy_bar=js&v=2.5.9&XDEBUG_SESSION_STOP=1:35
    displayTimeout .../admin/module/edit?name=TracyDebugger&collapse_info=1&_tracy_bar=js&v=2.5.9&XDEBUG_SESSION_STOP=1:302
    setTimeout handler*initTabs/</< .../admin/module/edit?name=TracyDebugger&collapse_info=1&_tracy_bar=js&v=2.5.9&XDEBUG_SESSION_STOP=1:297
    initTabs .../admin/module/edit?name=TracyDebugger&collapse_info=1&_tracy_bar=js&v=2.5.9&XDEBUG_SESSION_STOP=1:291
    forEach .../admin/module/edit?name=TracyDebugger&collapse_info=1&_tracy_bar=js&v=2.5.9&XDEBUG_SESSION_STOP=1:665
    initTabs .../admin/module/edit?name=TracyDebugger&collapse_info=1&_tracy_bar=js&v=2.5.9&XDEBUG_SESSION_STOP=1:264
    init .../admin/module/edit?name=TracyDebugger&collapse_info=1&_tracy_bar=js&v=2.5.9&XDEBUG_SESSION_STOP=1:254
    init .../admin/module/edit?name=TracyDebugger&collapse_info=1&_tracy_bar=js&v=2.5.9&XDEBUG_SESSION_STOP=1:388
    <anonymous> .../admin/module/edit?name=TracyDebugger&collapse_info=1:284
edit:1:155320

This has been going on for some time. Also persists after upgrade to v4.21.20. Refreshed modules, cleared all cookies and local storage related to TD to no avail.
Console looks like this and div#tracyConsoleEditor is empty:

console-without-editor.thumb.png.2051ddc2391b5dc18b9ee9dd4839c5f0.png
Any help on how I can back the console editor would be much appreciated.

Link to comment
Share on other sites

Hi @gebeer - I am not really sure, but my initial hunch is that somehow the last entered code is corrupt. Could you try deleting any browser LocalStorage entries for the site. You can go through and just delete the ones that refer to Tracy if you'd prefer.

Link to comment
Share on other sites

13 hours ago, adrian said:

Hi @gebeer - I am not really sure, but my initial hunch is that somehow the last entered code is corrupt. Could you try deleting any browser LocalStorage entries for the site. You can go through and just delete the ones that refer to Tracy if you'd prefer.

Thanks for that hint. I already had deleted cookies and local storage. Didn't help. Problem persists across browsers, also in private mode. So it doesn't seem to be related to local storage.

Link to comment
Share on other sites

Hi @gebeer - sorry that didn't help. Looking through the module code there are only a couple of places where "/admin/module/edit?name=TracyDebugger" appears. One is in the PW Info panel, so could you please disable that and see if it fixes things. The other is in the main module file, so could you try removing this block of code: https://github.com/adrianbj/TracyDebugger/blob/c499ad75ffce7ce473dfd32ef994339a27d61b83/TracyDebugger.module.php#L1124-L1135

 

Link to comment
Share on other sites

On 8/27/2020 at 9:00 PM, adrian said:

Hi @gebeer - sorry that didn't help. Looking through the module code there are only a couple of places where "/admin/module/edit?name=TracyDebugger" appears. One is in the PW Info panel, so could you please disable that and see if it fixes things. The other is in the main module file, so could you try removing this block of code: https://github.com/adrianbj/TracyDebugger/blob/c499ad75ffce7ce473dfd32ef994339a27d61b83/TracyDebugger.module.php#L1124-L1135

 

I tried both but it didn't help. Also I uninstalled and removed the module, deleted all cookies, local storage and session storage and then reinstalled. Problem persists.
Can't see what the invalid escape sequence could possibly be.
On my local dev install of the website, I don't have that problem.
I'll try to find the cause for this behaviour and will let you know here.
Thanks again.

  • Like 1
Link to comment
Share on other sites

Has anyone come across this error?

Parse error: syntax error, unexpected ':', expecting ';' or '{' in /home/********/public_html/site/assets/cache/FileCompiler/site/modules/TracyDebugger/includes/PwApiData.php on line 516

PW 3.0.148, Tracy Debugger 4.21.20, PHP 7.2.

line 516 is 

private function phpdoc_params(ReflectionMethod $method) : array {

Have tried a reinstall & cleared complied  files from > Modules. No errors on other sites on same server with same setup. 

Link to comment
Share on other sites

@dab - are you sure you're actually running PHP 7.2? That error is coming from a return type declaration (https://www.php.net/manual/en/functions.returning-values.php#functions.returning-values.type-declaration) which was available since PHP 7. That said, I didn't mean to exclude < 7 and I don't need the declaration, so the new version just committed should work for you.

  • Like 1
Link to comment
Share on other sites

@adrianThanks for the speedy reply. Most odd, WHM/Cpanel was reporting PHP 7.2, but I double checked with a "phpinfo" file & it showed PHP5.6! I reset the PHP version to PHP 7.2.32 & it's cleared the error.

Apologies for the incorrect info & thanks for the fix for <7 (& for such a great module)!  

  • Like 1
Link to comment
Share on other sites

Trying to upgrade TD to the latest version and I get this:

Fatal Error: Uncaught WireException: No download URL specified in wire/modules/Process/ProcessModule/ProcessModule.module:1072

Happens both on the Modules->New and Settings->Upgrades with the upgrade module. I could upload the zip but that's not the issue.

Reason for upgrade was another error message:

Fatal error: Uncaught Exception: Serialization of 'Closure' is not allowed in [no active file]:0
Stack trace:
#0 {main}
  thrown in [no active file] on line 0

which auto-magically began appearing. I'm not serializing any data and the error disappears when I turn off TD.

Any ideas on what's happening here?

Link to comment
Share on other sites

Hey @adrian! Just wondering: what's your take on extending current panel collection with custom tools on a case-by-case basis? Sorry if this has been discussed already, there's so much stuff in this thread that I can't keep up anymore ?

I just had a quick look and it seems that adding new panels is currently not possible without directly modifying the module file(s) and dropping the class file to the panels directory. I was wondering if you'd be open to adding some way of "injecting" custom panels from outside the module? My initial idea was something along the lines of allowing custom options to be pushed into the allPanels array by passing it to hookable methods at certain points and adding support for array values so that custom panel options could contain both name and path.

(I didn't actually try this. It's possible that hooks won't work due to load order and all that, so another option would be the Tracy module reading them from config settings; not quite as elegant or robust, but pretty much guaranteed to work.)

Anyway, just throwing in ideas. I'm working on some Wireframe related dev tools, and was thinking that it'd be neat to have them available in the admin — and what better way to do that than to introduce them to Tracy... ?

  • Like 2
Link to comment
Share on other sites

Hi @teppo - I'd love to make it easier to support custom panels.

It's interesting about the $allPanels array - it really wouldn't be necessary except for the title vs the name, eg "phpInfo" to "PHP Info". In most cases it would be easy to programmatically convert the case, except for those with acronyms (PHP, API, etc).

I think you are probably correct that hooks might be problematic because Tracy is always loaded before all other modules. Perhaps module authors who want to add new Tracy panels could simply provide me with the path and panel class name and I can have Tracy check the location if the module is installed. Perhaps as simple as adding a new $externalPanels array that is added to as needed?

This array could be merged into the $allPanels array which would probably need to be made multidimensional to support separate title and path properties so that https://github.com/adrianbj/TracyDebugger/blob/cc1c17e50487580f5c1e3485411d7c9a766b0a4f/TracyDebugger.module.php#L1526 would know what path to use to load these external panels.

Anyway, I'll have a play around and see what I think will work best and send you a test version to work with.

  • Like 2
Link to comment
Share on other sites

  • adrian pinned and locked this topic
  • adrian unpinned and pinned this topic
Guest
This topic is now closed to further replies.
×
×
  • Create New...