Issue Bug Closed

#53682Exception '$toolbarItem "shortcuts" must implement interface ...\ToolbarItemHookInterface'

Jost Baron 11/15/13, 20:39 updated 10/02/18, 12:08

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