[TYPO3-english] Extbase Dependency Injection fails oddly

Nicola Cerchiari nicola.cerchiari at gmail.com
Wed Aug 5 09:45:50 CEST 2015


Hi,
I'm developing an extension on TYPO3 6.2.14 and in a class I'm using
constructor injection but oddly it fails on my production server while
works perfectly on my dev server.
The only noticeable difference between the 2 servers is the php version:
production is 5.4 while dev is 5.5 (if it matters at all).

My class tries to get Object Manager from extbase at instantiation like
this:










*/** * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface */protected
$objectManager;/** * @param
\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager */public
function __construct(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface
$objectManager){ $this->objectManager = $objectManager;}*

but on production this throws an exception stating $objectManager is
none/null/... :
*[...]Utility::__construct() must implement interface
TYPO3\CMS\Extbase\Object\ObjectManagerInterface, none given, called in[...]*

The class throwing the exception is called by a controller via an
$objectManager->get(...) method.
Of course I already flushed any kind of cache many (many) times among
modifications.

Anyone can point me out what am I missing here cause I really can't get it
:(.

Thanks to you all in advance,
Nicola


More information about the TYPO3-english mailing list