#53682Exception '$toolbarItem "shortcuts" must implement interface ...\ToolbarItemHookInterface'
Description
The backend does not work with PHP 5.5.6 anymore. The exception thrown is this one:
$toolbarItem “shortcuts” must implement interface TYPO3\CMS\Backend\Toolbar\ToolbarItemHookInterface
To reproduce, create a new 6.2 installation using the wizard in the install tool, and run it on PHP 5.5.6.
This does not happen on PHP 5.5.5 or 5.4.22, I have not tested other versions. Ernesto Baschny pointed out that this problem occurred with PHP 5.3.3 too, maybe that info helps?
Link to the PHP bug tracker: https://bugs.php.net/bug.php?id=66107
The following classes are affected:
- typo3/sysext/backend/Classes/Toolbar/ToolbarItemHookInterface
- typo3/sysext/backend/Classes/Toolbar/ShortcutToolbarItem
- typo3/sysext/backend/Classes/Toolbar/LiveSearchToolbarItem
- typo3/sysext/backend/Classes/Toolbar/ClearCacheToolbarItem
- typo3/sysext/backend/Classes/Form/Element/TreeElement.php
- typo3/sysext/workspaces/Classes/ExtDirect/WorkspaceSelectorToolbarItem.php
- typo3/sysext/opendocs/Classes/Controller/OpendocsController.php
- typo3/sysext/sys_action/Classes/ActionToolbarMenu.php
To solve the issue temporarily you need to modify the constructor of those classes by removing the reference operator (&) of all referenced class parameters.
public function __construct(SomeClassNameHere &$backendReference = NULL)
public function __construct(SomeClassNameHere $backendReference = NULL)Reviews 10
- TYPO3_4-5 33308[TASK] Optimize speed for instantiating class with arguments
- main 33307[TASK] Optimize speed for instantiating class with arguments
- TYPO3_4-5 27514[BUGFIX] Namespace usage in test
- TYPO3_4-7 27513[BUGFIX] Namespace usage in test
- TYPO3_4-5 26643[TASK] Optimize speed for instantiating class with arguments
- TYPO3_4-7 26416[TASK] Optimize speed for instantiating class with arguments
- main 26344[BUGFIX] Pass references to constructor if required by API
- TYPO3_6-0 26414[TASK] Optimize speed for instantiating class with arguments
- TYPO3_6-1 26413[TASK] Optimize speed for instantiating class with arguments
- main 26363[TASK] Optimize speed for instantiating class with arguments
Related issues 5
- Feature #17795add the workspace selector to the cleaner backend toolbar
- Bug #33416Exception thrown by tslib_content->getContentObject when referenced TS objects are empty
- Bug #54425TYPO3\CMS\Frontend\ContentObject\ContentObject not found
- Bug #55811Namespace usage in 4.7
- Bug #62391TYPO3 4.5.37 requires PHP 5.3