Custom dashboard widget issue after upgrade php8

I have a website on MODX Cloud which is running on 2.8.4 and I upgraded to PHP8 partly due to the requirement of the latest version of Commerce, however, the custom dashboard widget I was using appears to cause the dashboard to not load. It was working fine until the upgrade to PHP8.

The code that is in use is

<?php
return $modx->getChunk('custom.dashboard');

The chunk is simply some HTML and inline styling which lists some quick links for clients to maintain their site. It is set as a widget type Inline PHP Widget and namespace Core.

Is there something different with PHP8 ?

The class core/model/modx/moddashboardwidget.class.php uses the PHP function create_function that was removed in PHP 8.

Here is a pull request with a fix:

Have tried the suggested fix but that doesn’t appear to have worked. Not sure if the fix is compatible with 2.8.4 or Rev 3.

The linked fix is for MODX 2.x.

Did you download the new file moddashboardwidget.class.php and replace it in the folder core/model/modx?

It worked when I tested it.

I did only try the fix in the thread. But can now see there were several commits. I have now used the latest and it now works as expected. Thanks for your help, it is appreciated.