Bruno17/MIGX

Various Deprecated Warnings using 3.0.2-beta1 on PHP 8 in MODX 3.0.X

iskri opened this issue · 2 comments

I'm using 3.0.2-beta1 and MODX 3.0.4 on PHP 8.3. The Issue has been present in all MODX 3 on PHP8.

When editing a resource that has MIGX applied, I see the following warnings in the HTML behind the MODX interface:

Deprecated:  explode(): Passing null to parameter #2 ($string) of type string is deprecated in /www/core/components/migx/model/migx/migx.class.php on line 587

(ERROR @ /www/core/src/Revolution/modX.php : 1709) [OnDocFormPrerender]
Deprecated:  strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /www/core/src/Revolution/modElement.php on line 729

 (ERROR @ /www/core/src/Revolution/modX.php : 1709) [OnDocFormPrerender]
Deprecated:  Optional parameter $class declared before required parameter $version is implicitly treated as a required parameter in /www/core/components/versionx/model/versionx.class.php on line 489

And when editing a MIGX item the popup displays the following error:

[2024-05-08 16:11:26] (ERROR @ /www/core/src/Revolution/modX.php : 1709) [OnTVInputRenderList] Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /www/core/src/Revolution/modManagerController.php on line 1012

And when adding a MIGX item the popup displays the following error above the fields:

[2024-05-08 16:19:09] (ERROR @ /www/core/src/Revolution/modX.php : 1709)
[OnTVInputRenderList]

Deprecated:  explode(): Passing null to parameter #2 ($string) of type string is deprecated in /www/core/src/Revolution/modManagerController.php on line 1012

Deprecated: hash(): Passing null to parameter #2 ($data) of type string is deprecated in /www/core/src/Revolution/Processors/Element/TemplateVar/Renders/mgr/input/image.class.php on line 56

Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /www/core/src/Revolution/Processors/Element/TemplateVar/Renders/mgr/input/listbox-multiple.class.php on line 26

Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /www/core/src/Revolution/Processors/Element/TemplateVar/Renders/mgr/input/listbox-multiple.class.php on line 26

I have tried fixing the deprecated warnings manually but it just renders MIGX non-functioning. Unsure how to proceed. Are there any updates on the way to improve PHP8 compatibility?

That are just warnings, which, I think, you should be able to hide by setting the system setting debug to 0.
PRs with fixes for specific warnings are allways welcome.

Appreciate the quick response. Thanks Bruno!