contao / contao-manager

Contao Manager
GNU Lesser General Public License v3.0
85 stars 33 forks source link

Datenbankmigrationen werden bei PHP-Warnungen nicht korrekt erkannt #726

Closed contaoacademy closed 1 year ago

contaoacademy commented 2 years ago

Wenn beim Aufruf von contao:migrate PHP-Warnungen ausgegeben werden, dann führt dies dazu, dass der Contao Manager keine validen JSON-Daten bekommt und keine Migrationen erkennt.

Lösungsvorschlag @ausi Für JSON commands sollten wir display_errors=0 setzen und STDERR ignorieren (was wir evtl. aber schon tun)

siehe auch Slack: https://contao.slack.com/archives/CGSEPHEV7/p1664287239672519

Beispiel Warnings unter PHP 8 und Contao 4.13 für Erweiterung simple-job-manager

PHP Warning:  Undefined array key "tl_class" in /demo_latest/var/cache/prod/contao/dca/tl_module.php on line 277
Warning: Undefined array key "tl_class" in /demo_latest/var/cache/prod/contao/dca/tl_module.php on line 277
PHP Warning:  Undefined array key "deleteConfirm" in /demo_latest/var/cache/prod/contao/dca/tl_sjm_organisation.php on line 18
Warning: Undefined array key "deleteConfirm" in /demo_latest/var/cache/prod/contao/dca/tl_sjm_organisation.php on line 18
PHP Warning:  Undefined array key "deleteConfirm" in /demo_latest/var/cache/prod/contao/dca/tl_sjm_jobs.php on line 15
Warning: Undefined array key "deleteConfirm" in /demo_latest/var/cache/prod/contao/dca/tl_sjm_jobs.php on line 15
fritzmg commented 2 years ago

I agree that these commands should ignore the warnings - however you should still fix the warnings ;)

contaoacademy commented 2 years ago

see: https://github.com/slashworks/contao-simple-job-manager-bundle/issues/7

ausi commented 2 years ago

Für JSON commands sollten wir display_errors=0 setzen

https://github.com/contao/contao/pull/5331

und STDERR ignorieren (was wir evtl. aber schon tun)

This still needs to be checked.

aschempp commented 2 years ago

I think it's best if the Manager disables error output in https://github.com/contao/contao-manager/blob/main/api/Process/ConsoleProcessFactory.php#L253 same as other config handling.

aschempp commented 1 year ago

fixed in ae4a0470d9d30444c8f46d978517cc82972a5be1