[TYPO3-english] Command Controller: I can't execute a command that uses class repositories of my extension

Mikel lists at con-version.com
Tue Nov 7 17:00:07 CET 2017


> But really thanks... So far at least i can access the repository but my biggest concern is actually how to get from here to be able to use findAll(), to auto generate my files as described in the initial post. Any idea why it works with findByUid() and not with findAll?

The repository expects a storage page by default. As you don’t have a module nor a plugin, your typoscript settings are ignored in that case.
So you have to set the repository to disrespect the storage page globally or you can set it in your task.

Example for ignore the storage page in the task only:

public function execute() {
   $objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
   /** @var CustomerRepository $apprep */
   $apprep = $objectManager->get(\Conversion\ConversionWebsite\Domain\Repository\CustomerRepository::class);
   /** @var Typo3QuerySettings $querySettings */
   $querySettings = $objectManager->get(Typo3QuerySettings::class);
   $querySettings->setRespectStoragePage(FALSE);
   $apprep->setDefaultQuerySettings($querySettings);

   \TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump($apprep->findAll());

   return TRUE;

}

Mikel


More information about the TYPO3-english mailing list