Bug #59959
closedLiveSearchToolbarItem not initialized correctly in \sysext\backend\Classes\Controller\BackendController.php
100%
Description
in the function initializeCoreToolbarItems() line 138 the path to the LiveSearchToolbarItem class is not set correctly but escaped with a double back slash at the beginning (line 142), compare with the Shortcut and ClearCache Toolbar Items
$coreToolbarItems = array(
'shortcuts' => 'TYPO3\\CMS\\Backend\\Toolbar\\ShortcutToolbarItem',
'clearCacheActions' => 'TYPO3\\CMS\\Backend\\Toolbar\\ClearCacheToolbarItem',
'liveSearch' => '\\TYPO3\\CMS\\Backend\\Toolbar\\LiveSearchToolbarItem'
);
The consequence is that the LiveSearchToolbarItem Class cannot be extended (former XClass) using the naming conventions because the Extension class is not detected by the GeneralUtility:makeInstance() function. So
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects']['TYPO3\\CMS\\Backend\\Toolbar\\LiveSearchToolbarItem'] = array('className' => 'somePath');
will not work, instead you have to use
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects']['\TYPO3\\CMS\\Backend\\Toolbar\\LiveSearchToolbarItem'] = array('className' => 'somePath');
to get the LiveSearchToolbarItem class extended at the moment.
protected function initializeCoreToolbarItems() {
$coreToolbarItems = array(
'shortcuts' => 'TYPO3\\CMS\\Backend\\Toolbar\\ShortcutToolbarItem',
'clearCacheActions' => 'TYPO3\\CMS\\Backend\\Toolbar\\ClearCacheToolbarItem',
'liveSearch' => '\\TYPO3\\CMS\\Backend\\Toolbar\\LiveSearchToolbarItem'
);
foreach ($coreToolbarItems as $toolbarItemName => $toolbarItemClassName) {
$toolbarItem = GeneralUtility::makeInstance($toolbarItemClassName, $this);
if (!$toolbarItem instanceof \TYPO3\CMS\Backend\Toolbar\ToolbarItemHookInterface) {
throw new \UnexpectedValueException('$toolbarItem "' . $toolbarItemName . '" must implement interface TYPO3\\CMS\\Backend\\Toolbar\\ToolbarItemHookInterface', 1195126772);
}
if ($toolbarItem->checkAccess()) {
$this->toolbarItems[$toolbarItemName] = $toolbarItem;
} else {
unset($toolbarItem);
}
}
}
Solution remove the first \\ in line 142 to make an instance of the LiveSearchToolbarItem
Updated by Gerrit Code Review over 10 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/31475
Updated by Gerrit Code Review over 10 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/31475
Updated by Gerrit Code Review over 10 years ago
Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/31477
Updated by Gernot Schulmeister over 10 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset f31e4f0be83b0b5381f8ef5d91d9b0b66e866ef6.