Bruno17 / MIGX

MIGX for revo 2.2 and above
83 stars 78 forks source link

Trouble saving config in PHP 8 #378

Closed jmacdonald-spectacle closed 1 year ago

jmacdonald-spectacle commented 3 years ago

Switched to PHP 8 and found trouble saving my configs. After I rebuilt one, I have tracked down what causes the problem.

If I enable duplicate_migx or remove_migx in either Contextmenues or Columnbuttons, 'Save and Close' will not close the MIGX window. If I uncheck them, no problem. (edit_migx is not a problem.)

Further, if I click the Save button and then the Close button, the window closes, but the changes aren't saved. I think this is because the 'Close' button is really a 'Cancel' button and should be named as such.

PHP 7.4 works fine.

I get the following 500 error in the browser console and server log:

POST /assets/components/migx/connector.php HTTP/2.0

and this nginx error in the server log:

30320#0: *1408556 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Call to undefined function each() in /var/www/vhosts/spectaclegroup.net/acenet-2021-02/core/components/migx/processors/mgr/migxconfigs/update.php:128
Stack trace:
#0 /var/www/vhosts/spectaclegroup.net/acenet-2021-02/core/components/migx/processors/mgr/migxdb/update.php(18): include_once()
#1 /var/www/vhosts/spectaclegroup.net/acenet-2021-02/core/model/modx/modprocessor.class.php(369): include('...')
#2 /var/www/vhosts/spectaclegroup.net/acenet-2021-02/core/model/modx/modprocessor.class.php(185): modDeprecatedProcessor->process()
#3 /var/www/vhosts/spectaclegroup.net/acenet-2021-02/core/model/modx/modx.class.php(1770): modProcessor->run()
#4 /var/www/vhosts/spectaclegroup.net/acenet-2021-02/core/model/modx/modconnectorresponse.class.php(144): modX->runProcessor()
#5 /var/www/vhosts/spectaclegroup.net/acenet-2021-02/core/model/modx/modconnectorrequest.class.php(86): modConnectorResponse->outputContent()
#6 /var/www/vhosts/spectaclegroup.net/acenet-2021-02/core/" while reading response header from upstream

MODX 2.8.3; MIGX 2.13.0; PHP 8.0.7

jmacdonald-spectacle commented 2 years ago

An update on this. I was really hoping PHP 8 was to blame but it's still not working with PHP 8.0.10

jmacdonald-spectacle commented 2 years ago

Apparently: "This function has been DEPRECATED as of PHP 7.2.0, and REMOVED as of PHP 8.0.0. Relying on this function is highly discouraged."

https://www.php.net/manual/en/function.each

So, I can live with that. Hope it gets fixed someday.

jmacdonald-spectacle commented 1 year ago

No longer a problem in MIGX 3.0.0-alpha5