Issue Bug Closed

#72706Manually instantiated UriBuilder is incomplete

Aimeos no-lastname-given 01/14/16, 17:33 updated 02/27/20, 12:41

Description

When trying to instantiate the UriBuilder object in a scheduler task using the object manager, the resulting object is incomplete, esp. the ContentObjectRenderer instance is missing. This results in a fatal error when trying to generate a link.

Example code in scheduler task:

$objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( \TYPO3\CMS\Extbase\Object\ObjectManager::class );
$uriBuilder = $objectManager->get( \TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::class );

$uriBuilder->setTargetPageUid( $pageid )->setArguments( array() );
$url = $uriBuilder->buildFrontendUri();

It worked from 7.0 to at least 7.3 but seemed to vanish in 7.4 again.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.