georgringer / redirect_generator

Generate redirect entries
Other
13 stars 11 forks source link

Commands can not be autowired #25

Open helmutstrasser opened 10 months ago

helmutstrasser commented 10 months ago

TYPO3 v11.5.33 PHP v8.2 georgringer/redirect-generator v1.0.0

For the commands ImportRedirectCommand and ExportRedirectCommand the front- and backend throw the exception

(1/1) Symfony\Component\DependencyInjection\Exception\RuntimeException Cannot autowire service "GeorgRinger\RedirectGenerator\Command\ExportRedirectCommand": argument "$name" of method "__construct()" is type-hinted "string", you should configure its value explicitly.

If I change the order of the arguments in the according constructor from

public function __construct( string $name = null, NotificationHandler $notificationHandler ) {}

to

public function __construct( NotificationHandler $notificationHandler, string $name = null ) {}

everything is working.

helmutstrasser commented 10 months ago

Ok, I see this has been fixed for version v12. Could you please backport this for TYPO3 v11?