Commit d9c3afa3 authored by Oliver Bartsch's avatar Oliver Bartsch
Browse files

[!!!][TASK] Remove RecordListController hooks

The RecordListController hooks were migrated
to PSR-14 events and are therefore now removed.

Resolves: #96178
Related: #92062
Releases: main
Change-Id: Ibb56c9a6e9e4233ff2ed74f61f2e610841f3428a
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72439


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 34e4d92f
......@@ -163,6 +163,8 @@ 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']['recordlist/Modules/Recordlist/index.php']['drawHeaderHook']`
- :php:`$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['recordlist/Modules/Recordlist/index.php']['drawFooterHook']`
- :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/classes/class.frontendedit.php']`
......
......@@ -448,11 +448,13 @@ return [
'$GLOBALS[\'TYPO3_CONF_VARS\'][\'SC_OPTIONS\'][\'recordlist/Modules/Recordlist/index.php\'][\'drawHeaderHook\']' => [
'restFiles' => [
'Deprecation-92062-MigrateRecordListControllerHooksToAnPSR-14Event.rst',
'Breaking-96107-DeprecatedFunctionalityRemoved.rst',
],
],
'$GLOBALS[\'TYPO3_CONF_VARS\'][\'SC_OPTIONS\'][\'recordlist/Modules/Recordlist/index.php\'][\'drawFooterHook\']' => [
'restFiles' => [
'Deprecation-92062-MigrateRecordListControllerHooksToAnPSR-14Event.rst',
'Breaking-96107-DeprecatedFunctionalityRemoved.rst',
],
],
'$GLOBALS[\'TYPO3_CONF_VARS\'][\'BE\'][\'lockBeUserToDBmounts\']' => [
......
<?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\Recordlist\HookProvider;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Recordlist\Event\RenderAdditionalContentToRecordListEvent;
/**
* This class provides a replacement for the existing hooks of the RecordListController.
*
* @internal Please note that this class will likely be removed in TYPO3 v12 and Extension Authors should
* switch to PSR-14 event listeners.
*/
class AddToRecordListHookProvider
{
public function __invoke(RenderAdditionalContentToRecordListEvent $event)
{
if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['recordlist/Modules/Recordlist/index.php']['drawHeaderHook']) && count($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['recordlist/Modules/Recordlist/index.php']['drawHeaderHook']) > 0) {
trigger_error('The hook "recordlist/Modules/Recordlist/index.php" "drawHeaderHook" has been marked as deprecated. Use PSR-14 event RenderAdditionalContentToRecordListEvent insted. ', E_USER_DEPRECATED);
}
if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['recordlist/Modules/Recordlist/index.php']['drawFooterHook']) && count($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['recordlist/Modules/Recordlist/index.php']['drawFooterHook']) > 0) {
trigger_error('The hook "recordlist/Modules/Recordlist/index.php" "drawFooterHook" has been marked as deprecated. Use PSR-14 event RenderAdditionalContentToRecordListEvent insted. ', E_USER_DEPRECATED);
}
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['recordlist/Modules/Recordlist/index.php']['drawHeaderHook'] ?? [] as $hook) {
$params = [
'request' => $event->getRequest(),
];
$null = null;
$event->addContentAbove(GeneralUtility::callUserFunction($hook, $params, $null));
}
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['recordlist/Modules/Recordlist/index.php']['drawFooterHook'] ?? [] as $hook) {
$params = [
'request' => $event->getRequest(),
];
$null = null;
$event->addContentBelow(GeneralUtility::callUserFunction($hook, $params, $null));
}
}
}
......@@ -35,8 +35,3 @@ services:
TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList:
shared: false
public: true
TYPO3\CMS\Recordlist\HookProvider\AddToRecordListHookProvider:
tags:
- name: event.listener
identifier: 'record-list-content-legacy-hook'
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