Extension do not work with EXT:autoloader
After the annotation Plugin Loader of the extension autoloader calling this method, the following exception is thrown:
$configuration = $annotationReader->getMethodAnnotation($method, Plugin::class);
(1/2) Doctrine\Common\Annotations\AnnotationException
[Creation Error] An error occurred while instantiating the annotation @Api\Access declared on method Mediagear\Jdcompetition\Controller\ItemsRestController::getCountriesAction(): "TYPO3\CMS\Core\Cache\CacheManager can not be injected/instantiated during ext_localconf.php loading. Use lazy loading instead.".
Comments (3)
-
reporter -
Thanks for reporting!
Not sure how we can fix this inside of the nnrestapi-extension – but your workaround is very useful! -
- changed status to resolved
Closing this and marking it as conflict with currently no fix. EXT:autoloader will need to add an option to ignore certain Annotations.
Added a hint (and the workaround, THX to Alexander) in the documentation: https://bitbucket.org/99grad-team/nnrestapi/commits/7d60a95136418763fdd9acdf80c5ab960cb57a36
- Log in to comment
Found a solution:
I moved the api code from Vendor/Ext/Controller/ItemsController.php to Vendor/Ext/Api/Items.php
This way, EXT:autoloader do not scan it anymore, because it is only looking inside Controller Folder/NS