Commit 34e4d92f authored by Oliver Bartsch's avatar Oliver Bartsch
Browse files

[!!!][TASK] Remove ClearCacheActions hook

The ClearCacheActions hook is superseded
by a PSR-14 event.

Therefore, the hook and the corresponding
interface are now removed.

Resolves: #96181
Related: #95083
Releases: main
Change-Id: I2e397b59b03ae4ed7ad2496889503822172bec00
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72443


Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Tested-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Tested-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
parent a5f33ae6
...@@ -18,7 +18,6 @@ namespace TYPO3\CMS\Backend\Backend\ToolbarItems; ...@@ -18,7 +18,6 @@ namespace TYPO3\CMS\Backend\Backend\ToolbarItems;
use Psr\EventDispatcher\EventDispatcherInterface; use Psr\EventDispatcher\EventDispatcherInterface;
use TYPO3\CMS\Backend\Backend\Event\ModifyClearCacheActionsEvent; use TYPO3\CMS\Backend\Backend\Event\ModifyClearCacheActionsEvent;
use TYPO3\CMS\Backend\Routing\UriBuilder; use TYPO3\CMS\Backend\Routing\UriBuilder;
use TYPO3\CMS\Backend\Toolbar\ClearCacheActionsHookInterface;
use TYPO3\CMS\Backend\Toolbar\ToolbarItemInterface; use TYPO3\CMS\Backend\Toolbar\ToolbarItemInterface;
use TYPO3\CMS\Core\Authentication\BackendUserAuthentication; use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
use TYPO3\CMS\Core\Page\PageRenderer; use TYPO3\CMS\Core\Page\PageRenderer;
...@@ -83,23 +82,6 @@ class ClearCacheToolbarItem implements ToolbarItemInterface ...@@ -83,23 +82,6 @@ class ClearCacheToolbarItem implements ToolbarItemInterface
$this->optionValues[] = 'all'; $this->optionValues[] = 'all';
} }
if (!empty($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['additionalBackendItems']['cacheActions'])) {
trigger_error(
'The hook $TYPO3_CONF_VARS[SC_OPTIONS][additionalBackendItems][cacheActions] is deprecated and will stop working in TYPO3 v12.0. Use the ModifyClearCacheActionsEvent instead.',
E_USER_DEPRECATED
);
}
// Hook for manipulating cacheActions
// @deprecated will be removed in TYPO3 v12.0.
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['additionalBackendItems']['cacheActions'] ?? [] as $cacheAction) {
$hookObject = GeneralUtility::makeInstance($cacheAction);
if (!$hookObject instanceof ClearCacheActionsHookInterface) {
throw new \UnexpectedValueException($cacheAction . ' must implement interface ' . ClearCacheActionsHookInterface::class, 1228262000);
}
$hookObject->manipulateCacheActions($this->cacheActions, $this->optionValues);
}
$event = new ModifyClearCacheActionsEvent($this->cacheActions, $this->optionValues); $event = new ModifyClearCacheActionsEvent($this->cacheActions, $this->optionValues);
$event = $eventDispatcher->dispatch($event); $event = $eventDispatcher->dispatch($event);
$this->cacheActions = $event->getCacheActions(); $this->cacheActions = $event->getCacheActions();
......
<?php
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Backend\Toolbar;
/**
* Interface for classes which hook into \TYPO3\CMS\Backend\Toolbar\ClearCacheToolbarItem and manipulate CacheMenuItems array
* @deprecated since TYPO3 v11 LTS, will be removed in TYPO3 v12.0. Use the PSR-14-based ModifyClearCacheActionsEvent instead.
*/
interface ClearCacheActionsHookInterface
{
/**
* Modifies CacheMenuItems array
*
* @param array $cacheActions Array of CacheMenuItems
* @param array $optionValues Array of AccessConfigurations-identifiers (typically used by userTS with options.clearCache.identifier)
*/
public function manipulateCacheActions(&$cacheActions, &$optionValues);
}
...@@ -35,6 +35,7 @@ The following PHP classes that have previously been marked as deprecated for v11 ...@@ -35,6 +35,7 @@ The following PHP classes that have previously been marked as deprecated for v11
The following PHP interfaces that have previously been marked as deprecated for v11 and were now removed: The following PHP interfaces that have previously been marked as deprecated for v11 and were now removed:
- :php:`\TYPO3\CMS\Backend\Toolbar\ClearCacheActionsHookInterface`
- :php:`\TYPO3\CMS\Core\Resource\Hook\FileDumpEIDHookInterface` - :php:`\TYPO3\CMS\Core\Resource\Hook\FileDumpEIDHookInterface`
- :php:`\TYPO3\CMS\Extbase\Mvc\View\ViewInterface` - :php:`\TYPO3\CMS\Extbase\Mvc\View\ViewInterface`
- :php:`\TYPO3\CMS\Recordlist\RecordList\RecordListHookInterface` - :php:`\TYPO3\CMS\Recordlist\RecordList\RecordListHookInterface`
...@@ -160,6 +161,7 @@ The following global variables have been removed: ...@@ -160,6 +161,7 @@ The following global variables have been removed:
The following hooks have been removed: The following hooks have been removed:
- :php:`$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['additionalBackendItems']['cacheActions']`
- :php:`$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['FileDumpEID.php']['checkFileAccess']` - :php:`$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['FileDumpEID.php']['checkFileAccess']`
- :php:`$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/browse_links.php']['browserRendering']` - :php:`$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/browse_links.php']['browserRendering']`
- :php:`$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.db_list_extra.inc']['actions']` - :php:`$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.db_list_extra.inc']['actions']`
......
...@@ -523,6 +523,7 @@ return [ ...@@ -523,6 +523,7 @@ return [
'$GLOBALS[\'TYPO3_CONF_VARS\'][\'SC_OPTIONS\'][\'additionalBackendItems\'][\'cacheActions\']' => [ '$GLOBALS[\'TYPO3_CONF_VARS\'][\'SC_OPTIONS\'][\'additionalBackendItems\'][\'cacheActions\']' => [
'restFiles' => [ 'restFiles' => [
'Deprecation-95083-BackendToolbarCacheActionsHook.rst', 'Deprecation-95083-BackendToolbarCacheActionsHook.rst',
'Breaking-96107-DeprecatedFunctionalityRemoved.rst',
], ],
], ],
'$GLOBALS[\'TYPO3_CONF_VARS\'][\'SC_OPTIONS\'][\'typo3/class.db_list_extra.inc\'][\'actions\']' => [ '$GLOBALS[\'TYPO3_CONF_VARS\'][\'SC_OPTIONS\'][\'typo3/class.db_list_extra.inc\'][\'actions\']' => [
......
...@@ -1832,6 +1832,7 @@ return [ ...@@ -1832,6 +1832,7 @@ return [
'TYPO3\CMS\Backend\Toolbar\ClearCacheActionsHookInterface' => [ 'TYPO3\CMS\Backend\Toolbar\ClearCacheActionsHookInterface' => [
'restFiles' => [ 'restFiles' => [
'Deprecation-95083-BackendToolbarCacheActionsHook.rst', 'Deprecation-95083-BackendToolbarCacheActionsHook.rst',
'Breaking-96107-DeprecatedFunctionalityRemoved.rst',
], ],
], ],
'TYPO3\CMS\Recordlist\RecordList\RecordListHookInterface' => [ 'TYPO3\CMS\Recordlist\RecordList\RecordListHookInterface' => [
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment