contao / core-bundle

[READ-ONLY] Contao Core Bundle
GNU Lesser General Public License v3.0
123 stars 58 forks source link

[4.0.0-RC1] The console help command shows an error for `contao:automator` #272

Closed xchs closed 9 years ago

xchs commented 9 years ago

The Symfony console help outputs an PHP error for the following Contao command:

$ app/console help contao:automator
PHP Fatal error:  Method Contao\CoreBundle\Command\AutomatorCommand::__toString() must not throw an exception in /var/www/contao4/develop/vendor/symfony/symfony/src/Symfony/Component/Console/Descriptor/TextDescriptor.php on line 0
[2015-05-16 02:25:31] php.EMERGENCY: Fatal Error: Method Contao\CoreBundle\Command\AutomatorCommand::__toString() must not throw an exception {"type":1,"file":"/var/www/contao4/develop/vendor/symfony/symfony/src/Symfony/Component/Console/Descriptor/TextDescriptor.php","line":0,"level":-1,"stack":[]}

  [Symfony\Component\Debug\Exception\FatalErrorException]
  Error: Method Contao\CoreBundle\Command\AutomatorCommand::__toString() must not throw an exception
aschempp commented 9 years ago

@leofeyer I guess the framework service was not injected. Voting again for constructor injection ;-)

leofeyer commented 9 years ago

It does not matter how the service is injected. If we don't initialize it in the generateCommandMap() method, it will never work :)

Fixed in e618cf4103b8316a1c31d6c9a831783d83a376fe.