Undefined array key "window_id"

My error log is filling up with these messages:

/home1/xxxxxx/public_html/xxxxxx/core/cache/mgr/smarty/default/61b3c8647fa044f6c1f7b6a3598c226d8e76c5e2_0.file.migx.tpl.php : 83) PHP warning: Undefined array key “window_id”

I’ve been cleaning up a test site, deleting old resources, extras, chunks, TVs, etc. Somewhere along the way my error log started filling up with these messages. It appears to be MIGX related, but I can’t track it down. It seems to happen when I edit a resource in the manager, including those resources that do not have MIGX assigned.

I’ve looked at all the the MIGX tvs, checks, settings, etc. But I don’t really know what I’m looking for.

Any thoughts?


Modx 2.8.5

PHP Version 8.1.17

All extras are up to date.

It’s definitely an extra. I can’t find window_id in the MODX code.

It’s probably this line in the code that produces the PHP warning:

The code tries to read window_id from $_REQUEST but this request parameter doesn’t exist.
It’s probably not a setting that is wrong, but just PHP 8 that generates more warnings that PHP 7.

I’m not sure how to fix it, as Smarty creates the PHP code that then produces the warning.

Thank you all for looking at this. I have a couple of other sites on this same server, all for testing, sandbox work, so nothing critical. As I look at the error logs on those sites, they too are filled with PHP warnings of various types.

This is from one of the sites on the same server:

/home1/xxxxxx/public_html/xxxxxx/core/vendor/xpdo/xpdo/src/xPDO/xPDO.php Could not load class: modFileHandler from modfilehandler

This is from yet another on the same server. It is similar to the original error I posted but not specific to MIGX:

/home1/xxxxxx/public_html/xxxxxx/core/cache/mgr/smarty/default/ba525efb997a433c2977a5630c595aea1e25592d_0.file.migx.tpl.php : 83) PHP warning: Undefined array key “window_id”

There are a bunch of other php warnings but they are specific to certain Extras that I don’t really care about. When I uninstall them, those errors go away.

Is it possible that having multiple MODCX sites on the same shared server, might be a factor here?

I think, this can be fixed by changing that line to

    {if array_key_exists('window_id',$smarty.request)}
        this.parent_window = '{$smarty.request.window_id}';

I can’t think of any reason multiple sites on a shared server would be related to what you’re seeing, unless you were getting error messages that might indicate an overloaded DB server (and I don’t think you are).

I think almost all of them are caused by code that’s not ready for PHP 8.

If you happen to have a copy of PhpStorm, you can create a .php file with the full code from each file specified in an error message, set the PHP level to 8.whatever, and PhpStorm will highlight any PHP 8 errors and give more information if you hover over the highlighted code.