Closed liayn closed 3 years ago
Log output:
2020-10-08 15:14:03,706 [16941221] WARN - ractServiceLocatorTypeProvider - Unable to find PhpNamedElement by signature from "#M#C\TYPO3\CMS\Core\Context\UserAspect.get%id"
...
2020-10-14 00:56:59,577 [144041314] WARN - ractServiceLocatorTypeProvider - Unable to find PhpNamedElement by signature from "#M#M#?#M#C\TYPO3\CMS\Core\Utility\GeneralUtility.makeInstance%#K#C\TYPO3\CMS\Core\Context\Context.class.getAspect.get|#M#?frontend.user.get|#M#M#?#M#C\TYPO3\CMS\Core\Utility\GeneralUtility.makeInstance?\TYPO3\CMS\Core\Context\Context.getAspect.get|#M#M#M#C\TYPO3\CMS\Core\Utility\GeneralUtility.makeInstance.getAspect.get%id"
Here a code to reproduce:
<?php
declare(strict_types = 1);
namespace Test\TestProject;
use TYPO3\CMS\Core\Context\Context;
use TYPO3\CMS\Core\Context\Exception\AspectNotFoundException;
use TYPO3\CMS\Core\Context\Exception\AspectPropertyNotFoundException;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
class TestController extends ActionController
{
/**
* @var Context
*/
protected $context;
/**
* @param Context $context
*/
public function injectContext(Context $context)
{
$this->context = $context;
}
/**
* @throws AspectNotFoundException
* @throws AspectPropertyNotFoundException
*/
protected function getCurrentUserUid(): string
{
return $this->context->getAspect('frontend.user')->get('id');
}
}