contao / contao

Contao Open Source CMS
https://contao.org
GNU Lesser General Public License v3.0
340 stars 158 forks source link

Type error after updating to 4.13.33 in UserListCommand #6491

Closed flashgordono closed 10 months ago

flashgordono commented 10 months ago

Affected version(s)

4.13.33

Description

I got following Error after updating to 4.13.33

console.CRITICAL: Error thrown while running command "list --format=json". Message: "Contao\CoreBundle\Command\UserListCommand::__construct(): Argument #1 ($connection) must be of type Doctrine\DBAL\Connection, Contao\CoreBundle\Framework\ContaoFramework given, called in /public_html/var/cache/prod/ContainerBU0GqzV/getContao_Command_UserListService.php on line 23" {"exception":"[object] (TypeError(code: 0): Contao\\CoreBundle\\Command\\UserListCommand::__construct(): Argument #1 ($connection) must be of type Doctrine\\DBAL\\Connection, Contao\\CoreBundle\\Framework\\ContaoFramework given, called in /public_html/var/cache/prod/ContainerBU0GqzV/getContao_Command_UserListService.php on line 23 at /public_html/vendor/contao/core-bundle/src/Command/UserListCommand.php:34)","command":"list --format=json","message":"Contao\\CoreBundle\\Command\\UserListCommand::__construct(): Argument #1 ($connection) must be of type Doctrine\\DBAL\\Connection, Contao\\CoreBundle\\Framework\\ContaoFramework given, called in /public_html/var/cache/prod/ContainerBU0GqzV/getContao_Command_UserListService.php on line 23"} []

Quickfix: No error after locking to version 4.13.32

xprojects-de commented 10 months ago

i can confirm!

xprojects-de commented 10 months ago

see https://github.com/contao/contao/blob/d1d09c829a94d6b337c79ae7f217be190d512c6c/core-bundle/src/Resources/config/commands.yml#L124

https://github.com/contao/contao/blob/d1d09c829a94d6b337c79ae7f217be190d512c6c/core-bundle/src/Command/UserListCommand.php#L34

There is a wrong DI ...

xprojects-de commented 10 months ago

see https://github.com/contao/contao/pull/6492

fritzmg commented 10 months ago

Why was this not caught via CI in https://github.com/contao/contao/pull/6417 ?

xprojects-de commented 10 months ago

The test mocks the connection. That fits. Unfortunately I don't know where the Symfony conifg is tested!? :-)

fritzmg commented 10 months ago

We don't test for a valid DI config currently - but I assumed stuff like this would be caught by our functional tests at least.