[TYPO3-english] Re: Command Controller: I can't execute a command that uses class repositories of my extension
christian ewigfrost
christian-kulozik at gmx.net
Tue Nov 7 13:50:26 CET 2017
Quote: Mikel wrote on Tue, 07 November 2017 13:18
----------------------------------------------------
> Try to fetch a single record with findByUid instead of getting all with findAll. If you get a result, your repository has no records storage uid. You can set it global in TypoScript or you can change your repository settings.
> Just to go for sure: Rename your method to execute and let your class extend the AbstractTask of TYPO3.
>
> Does that solve the problem?
>
> Mikel
----------------------------------------------------
Same as before. I even tried to inject the repositories in the class of the CommandController:
/**
* hostRepository
*
* @var \Cjk\Icingaconfgen\Domain\Repository\HostRepository
* @inject
*/
protected $hostRepository;
/**
* servicesRepository
*
* @var \Cjk\Icingaconfgen\Domain\Repository\ServicesRepository
* @inject
*/
protected $servicesRepository;
And then i just tried to access the repository in the function:
$hosts = $this->hostRepository->findAll();
$services = $this->servicesRepository->findAll();
To be clear: The task seems to be run in the Scheduler without problems, but the code doesn't generate the files i want, whereas as a frontend Action it produces them without flaw. I didn't try your execute() suggestion yet.
More information about the TYPO3-english
mailing list