Jump to content

[SOLVED] version 4.26.67 error with console panel.


rick
 Share

Recommended Posts

Howdy Adrian,

I just upgraded to v4.26.67 in an attempt to fix a console error in the previous version. However this new error is different from the last. I read through the earlier post by nurkka, November 19, 2024 but your suggestions there did not resolve my issue.

My original error suddenly appeared this morning after logging into the admin. "Error in ConsolePanel" is displayed in the debug bar. Everything was fine last evening before I logged out. This morning after logging in I noticed the error. I followed your suggestions from the post above without affect. After upgrading Tracy to this new version I now get the following error:

Undefined array key "pwFunctions" in .../site/assets/cache/FileCompiler/site/modules/TracyDebugger/includes/PwApiData.php:25

This error is different from my original error which referenced a different file -- Sorry I don't have that exact filename as I deleted the cache as one of my troubleshooting steps. I believe it was the cached phpconsole file.

Please let me know what additional information you need from me.

Thanks!
Rick

Edited by rick
Closed due to pilot error.
Link to comment
Share on other sites

I am really baffled at the moment, but let's try to at least deal with fixing the error even if I can't figure out the actual cause.

Can you please make this change in PwApiData.php and let me know if it helps.

            elseif($type == 'proceduralFunctions') {
                $proceduralFunctionsFunctions = $this->getProceduralFunctions('Functions');
                $apiData = array('Functions' => isset($proceduralFunctionsFunctions['pwFunctions']) ? $proceduralFunctionsFunctions['pwFunctions'] : array());
                if(file_exists($this->wire('config')->paths->core . 'FunctionsAPI.php')) $apiData += array('FunctionsAPI' => $this->getProceduralFunctions('FunctionsAPI')['pwFunctions']);
            }

It should prevent the error, although we might end up with another one for $this->getProceduralFunctions('FunctionsAPI')['pwFunctions']) but that can be fixed the same way. 

I'd rather know why these aren't being populated though so if you feel like looking into the getProceduralFunctions() and getFunctionsInFile() to see where/why it's failing, that would be helpful.

I can't figure out why this isn't being reported by anyone else. I thought perhaps it might be a file permission issue with reading the core Functions.php and FunctionsAPI.php files but when I made these unreadable, I got a very different error.

Link to comment
Share on other sites

Ok, I made the change in PwApiData.php

            } elseif ($type == 'proceduralFunctions') {
                $proceduralFunctionsFunctions = $this->getProceduralFunctions('Functions');
                $apiData = array('Functions' => isset($proceduralFunctionsFunctions['pwFunctions']) ? $proceduralFunctionsFunctions['pwFunctions'] : array());
                if (file_exists($this->wire('config')->paths->core . 'FunctionsAPI.php')) $apiData += array('FunctionsAPI' => $this->getProceduralFunctions('FunctionsAPI')['pwFunctions']);

                /*             elseif($type == 'proceduralFunctions') {
                $apiData = array('Functions' => $this->getProceduralFunctions('Functions')['pwFunctions']);
                if(file_exists($this->wire('config')->paths->core . 'FunctionsAPI.php')) $apiData += array('FunctionsAPI' => $this->getProceduralFunctions('FunctionsAPI')['pwFunctions']);
 */  } ...

Cleared DB cache,
Refreshed modules,
Restarted PW and got the same errors...

Firefox_Screenshot_2025-03-15T15-04-57.172Z.jpg

Link to comment
Share on other sites

I feel like I must be missing something very obvious, but I don't understand how you can get an undefined array key when doing an isset() on it. This is essentially what we are doing:

image.thumb.png.5874a1b2d2c4d165e6a129e718b90e3f.png

 

Can you please take a look into those functions I mentioned above and figure out where they are failing to populate the ['pwFunctions'] key.

I just have no idea how to reproduce and haven't had any other reports related to the API data functions in years.

One final idea - I see that the line number of the error did change, so the files in /assets/cache/FileCompiler seem to be being updated, but I would maybe try deleting them all, just in case.

 

Link to comment
Share on other sites

Thanks @adrian!

Just an FYI...

My server has php tokenizer installed and accessible. Debian 12, php 8.3, mysql 15.1, and apache 2.4 installed Nov '24.

I completely uninstalled Tracy, deleted all Tracy related files from the server, and removed all references to Tracy in the DB.

I installed Tracy from Modules > New.

The Tracy Bar is not displayed at the bottom right of the screen.

I went back into Tracy settings and selected the Force superusers into DEVELOPMENT mode. <-- I read somewhere on here about that setting.

I submitted that change.

The Tracy bar now shows at the bottom right but still displays the previous two errors.

I unchecked the Force superuser checkbox and submitted that change.

The Tracy bar disappears.

Link to comment
Share on other sites

@adrian

I did a fresh install on localhost and Tracy runs just fine, so there must be something with my server. Although my localhost setup is the same as the server.

I'm going to mark this thread as solved.

Edited by rick
  • Like 1
Link to comment
Share on other sites

  • rick changed the title to [SOLVED] version 4.26.67 error with console panel.

Really weird for sure but maybe the answer can be found in that function that is calling token_get_all() still - I think it should be pretty easy for you to figure out whether there is an issue reading the Functions.php file or getting the tokens from it by putting some bd() calls in the appropriate places to see where it's getting to.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...