Errors when accessing package list/ updating extras

Whenever I go to Extras > Installer I get this error:

core/model/modx/processors/workspace/packages/getlist.class.php : 195) PHP warning: Trying to access array offset on value of type null

Also when I try to update an extra (in this case Commerce) I get a very long “Saving…” prompt after which no updating is initiated and the following errors appear:

core/model/modx/transport/modtransportpackage.class.php : 377) PHP warning: filesize(): stat failed for[...]
core/model/modx/transport/modtransportpackage.class.php : 651) PHP warning: A non-numeric value encountered

The same errors appeared after updating the Image+ extra (with a different url for the filesize stat error ofc), with the small difference that the update actually went through and is not stuck on the “Saving…” prompt.

How do I fix this?

MODX 2.8.5.
PHP 8.2

These log messages are only “PHP warnings”, so the correct working of your site is probably not affected by them.

The first warning (Trying to access array offset on value of type null) occurs, because the code tries to get update information from the package provider but receives an unexpected response.

You could change this line

to for example this code.

if (!is_array($updates)){
	$this->modx->log(modX::LOG_LEVEL_ERROR, 'Wrong checkForUpdates result for package ' . $package->get('signature'));
	$packageArray['updateable'] = false;
} else {
	$packageArray['updateable'] = (int)$updates['count'] >= 1 ? true : false;

You won’t see the PHP warning anymore, but the package provider still returns the wrong response.
(The code above logs for which package the warning occurs.)

What is the response and the response code of the AJAX-request in the “Network” tab of the developer tools in the browser?

So it seems like the issue is Redactor:

Wrong checkForUpdates result for package redactor-3.1.6-pl

I guess this is a case for @markh then?

Would love to tell you, but ofc when I tried it just now, everything worked fine and the update went through without problems :wink:

Try now - I’ve added an additional count attribute to the response (there was only a total attribute which iirc is used elsewhere).

It still claims an issue with Redactor. Do I have to do anything before trying it again? I cleared the cache but the error is still there…