diff --git a/composer.json b/composer.json index c0deb34aae4be9916495fa81ef8eb1d78d202652..a0c100488233a5d3a5a2bffa5fe2be7aee28321d 100644 --- a/composer.json +++ b/composer.json @@ -86,6 +86,7 @@ "typo3/sysext/fluid/Migrations/Code/ClassAliasMap.php", "typo3/sysext/info/Migrations/Code/ClassAliasMap.php", "typo3/sysext/lowlevel/Migrations/Code/ClassAliasMap.php", + "typo3/sysext/recordlist/Migrations/Code/ClassAliasMap.php", "typo3/sysext/reports/Migrations/Code/ClassAliasMap.php", "typo3/sysext/saltedpasswords/Migrations/Code/ClassAliasMap.php", "typo3/sysext/workspaces/Migrations/Code/ClassAliasMap.php" diff --git a/composer.lock b/composer.lock index edc4866b0138894edee037e2bcea9887799a99a1..898274f867e4f2a0aa2500fd2b23cc050cfd1c56 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "c2fe666b163be8ccee13df7d63c794cc", + "content-hash": "33161a8bc06421b8de725e3dfb422fae", "packages": [ { "name": "cogpowered/finediff", diff --git a/typo3/sysext/backend/Classes/Controller/PageLayoutController.php b/typo3/sysext/backend/Classes/Controller/PageLayoutController.php index b11a6d46868c0c9a34f92a6bc1eea9f27da6a429..5cc7768843bf524cc6dd628a20deb36681d62fa8 100644 --- a/typo3/sysext/backend/Classes/Controller/PageLayoutController.php +++ b/typo3/sysext/backend/Classes/Controller/PageLayoutController.php @@ -39,7 +39,6 @@ use TYPO3\CMS\Core\Versioning\VersionState; use TYPO3\CMS\Fluid\View\StandaloneView; use TYPO3\CMS\Fluid\ViewHelpers\Be\InfoboxViewHelper; use TYPO3\CMS\Frontend\Page\PageRepository; -use TYPO3\CMS\Recordlist\RecordList; /** * Script Class for Web > Layout module @@ -260,7 +259,7 @@ class PageLayoutController $this->MCONF['name'] = $this->moduleName; $this->perms_clause = $this->getBackendUser()->getPagePermsClause(Permission::PAGE_SHOW); // Get session data - $sessionData = $this->getBackendUser()->getSessionData(RecordList::class); + $sessionData = $this->getBackendUser()->getSessionData(__CLASS__); $this->search_field = !empty($sessionData['search_field']) ? $sessionData['search_field'] : ''; // GPvars: $this->id = (int)GeneralUtility::_GP('id'); @@ -274,7 +273,7 @@ class PageLayoutController $this->returnUrl = GeneralUtility::sanitizeLocalUrl(GeneralUtility::_GP('returnUrl')); $sessionData['search_field'] = $this->search_field; // Store session data - $this->getBackendUser()->setAndSaveSessionData(RecordList::class, $sessionData); + $this->getBackendUser()->setAndSaveSessionData(__CLASS__, $sessionData); // Load page info array: $this->pageinfo = BackendUtility::readPageAccess($this->id, $this->perms_clause); // Initialize menu diff --git a/typo3/sysext/backend/Classes/View/PageLayoutView.php b/typo3/sysext/backend/Classes/View/PageLayoutView.php index b39330499caca7947473028281fd6713a4c598b3..8a806b78c5e8be2d2f15dce6caf2b3ac137fdd99 100644 --- a/typo3/sysext/backend/Classes/View/PageLayoutView.php +++ b/typo3/sysext/backend/Classes/View/PageLayoutView.php @@ -2680,7 +2680,6 @@ class PageLayoutView implements LoggerAwareInterface * Initializes the clipboard for generating paste links * * - * @see \TYPO3\CMS\Recordlist\RecordList::main() * @see \TYPO3\CMS\Backend\Controller\ContextMenuController::clipboardAction() * @see \TYPO3\CMS\Filelist\Controller\FileListController::indexAction() */ diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-84399-ClassRecordListRenamedToRecordListController.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-84399-ClassRecordListRenamedToRecordListController.rst new file mode 100644 index 0000000000000000000000000000000000000000..cf965eb94774dc57e370a613908804ae3ade6e5d --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-84399-ClassRecordListRenamedToRecordListController.rst @@ -0,0 +1,38 @@ +.. include:: ../../Includes.txt + +====================================================================== +Deprecation: #84399 - Class RecordList renamed to RecordListController +====================================================================== + +See :issue:`84399` + +Description +=========== + +The PHP class :php:`TYPO3\CMS\Recordlist\RecordList` has been renamed to +:php:`TYPO3\CMS\Recordlist\Controller\RecordListController` + + +Impact +====== + +The old class name has been registered as class alias and will still work. +Old class name usage however is discouraged and should be avoided since, the +alias will vanish with core version 10. + + +Affected Installations +====================== + +Extensions that hook into the list module may be affected if type hinting +with the old classes as :php:`$parentObject`. + +The extension scanner will find affected extensions using the old class name. + + +Migration +========= + +Use new class name instead. + +.. index:: Backend, PHP-API, FullyScanned, ext:recordlist \ No newline at end of file diff --git a/typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php b/typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php index 173eb565162990b130a889819208144986c69c7e..5ac17f7bfcd25d651429351f1bfe0cfab02186e2 100644 --- a/typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php +++ b/typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php @@ -654,4 +654,9 @@ return [ 'Deprecation-84109-DeprecateDependencyResolver.rst', ], ], + 'TYPO3\CMS\Recordlist\RecordList' => [ + 'restFiles' => [ + 'Deprecation-84399-ClassRecordListRenamedToRecordListController.rst', + ], + ], ]; diff --git a/typo3/sysext/recordlist/Classes/RecordList.php b/typo3/sysext/recordlist/Classes/Controller/RecordListController.php similarity index 98% rename from typo3/sysext/recordlist/Classes/RecordList.php rename to typo3/sysext/recordlist/Classes/Controller/RecordListController.php index 84c7495ce8c8e445dc34c0b66d1cc34f7bdea469..2d42972b25abe22bb7d4c4f3fa857d48292bc15d 100644 --- a/typo3/sysext/recordlist/Classes/RecordList.php +++ b/typo3/sysext/recordlist/Classes/Controller/RecordListController.php @@ -1,5 +1,5 @@ <?php -namespace TYPO3\CMS\Recordlist; +namespace TYPO3\CMS\Recordlist\Controller; /* * This file is part of the TYPO3 CMS project. @@ -17,6 +17,7 @@ namespace TYPO3\CMS\Recordlist; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use TYPO3\CMS\Backend\Clipboard\Clipboard; +use TYPO3\CMS\Backend\Routing\UriBuilder; use TYPO3\CMS\Backend\Template\Components\ButtonBar; use TYPO3\CMS\Backend\Template\DocumentTemplate; use TYPO3\CMS\Backend\Template\ModuleTemplate; @@ -36,11 +37,12 @@ use TYPO3\CMS\Core\Type\Bitmask\Permission; use TYPO3\CMS\Core\TypoScript\TypoScriptService; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Versioning\VersionState; +use TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList; /** * Script Class for the Web > List module; rendering the listing of records on a page */ -class RecordList +class RecordListController { /** * Page Id for which to make the listing @@ -310,10 +312,8 @@ class RecordList } // Initialize the dblist object: - /** @var $dblist RecordList\DatabaseRecordList */ - $dblist = GeneralUtility::makeInstance(RecordList\DatabaseRecordList::class); - /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */ - $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class); + $dblist = GeneralUtility::makeInstance(DatabaseRecordList::class); + $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class); $dblist->script = (string)$uriBuilder->buildUriFromRoute('web_list'); $dblist->calcPerms = $calcPerms; $dblist->thumbs = $backendUser->uc['thumbnailsByDefault']; @@ -722,8 +722,7 @@ class RecordList 'justLocalized' => 'pages:' . $id . ':' . $languageUid, 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI') ]; - /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */ - $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class); + $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class); $redirectUrl = (string)$uriBuilder->buildUriFromRoute('record_edit', $parameters); $targetUrl = BackendUtility::getLinkToDataHandlerAction( '&cmd[pages][' . $id . '][localize]=' . $languageUid, diff --git a/typo3/sysext/recordlist/Migrations/Code/ClassAliasMap.php b/typo3/sysext/recordlist/Migrations/Code/ClassAliasMap.php new file mode 100644 index 0000000000000000000000000000000000000000..9b2c8ed6c9fe2e42e154c620bcb0be2bf8c2ba78 --- /dev/null +++ b/typo3/sysext/recordlist/Migrations/Code/ClassAliasMap.php @@ -0,0 +1,4 @@ +<?php +return [ + 'TYPO3\\CMS\\Recordlist\\RecordList' => \TYPO3\CMS\Recordlist\Controller\RecordListController::class, +]; diff --git a/typo3/sysext/recordlist/Migrations/Code/LegacyClassesForIde.php b/typo3/sysext/recordlist/Migrations/Code/LegacyClassesForIde.php new file mode 100644 index 0000000000000000000000000000000000000000..349b05498e5672ec63d09b90fe0d6053780afad7 --- /dev/null +++ b/typo3/sysext/recordlist/Migrations/Code/LegacyClassesForIde.php @@ -0,0 +1,13 @@ +<?php +namespace { + die('Access denied'); +} + +namespace TYPO3\CMS\Recordlist { + /** + * @deprecated since v9, will be removed in v10 + */ + class RecordList extends \TYPO3\CMS\Recordlist\Controller\RecordListController + { + } +} diff --git a/typo3/sysext/recordlist/composer.json b/typo3/sysext/recordlist/composer.json index 3cfc5dd2c3dc1d9dc761e51e9c77954950835b5a..479c0c3e186a9230d8b6e08a7311044c25a92417 100644 --- a/typo3/sysext/recordlist/composer.json +++ b/typo3/sysext/recordlist/composer.json @@ -30,6 +30,11 @@ "partOfMinimalUsableSystem": true }, "extension-key": "recordlist" + }, + "typo3/class-alias-loader": { + "class-alias-maps": [ + "Migrations/Code/ClassAliasMap.php" + ] } }, "autoload": { diff --git a/typo3/sysext/recordlist/ext_tables.php b/typo3/sysext/recordlist/ext_tables.php index 88ce599aebf2f228a8e0a82380909abee45f6158..d5989fe239cbb8702ee8a6a6c678a664db44e2e3 100644 --- a/typo3/sysext/recordlist/ext_tables.php +++ b/typo3/sysext/recordlist/ext_tables.php @@ -7,7 +7,7 @@ defined('TYPO3_MODE') or die(); '', '', [ - 'routeTarget' => \TYPO3\CMS\Recordlist\RecordList::class . '::mainAction', + 'routeTarget' => \TYPO3\CMS\Recordlist\Controller\RecordListController::class . '::mainAction', 'access' => 'user,group', 'name' => 'web_list', 'icon' => 'EXT:recordlist/Resources/Public/Icons/module-list.svg', diff --git a/typo3/sysext/sys_note/Classes/Hook/RecordListHook.php b/typo3/sysext/sys_note/Classes/Hook/RecordListHook.php index c5241a522d64c6927719fd0b31ad429f65851447..6f5b3a6ace2bcd5a31144efc076fa58e279091e5 100644 --- a/typo3/sysext/sys_note/Classes/Hook/RecordListHook.php +++ b/typo3/sysext/sys_note/Classes/Hook/RecordListHook.php @@ -16,6 +16,7 @@ namespace TYPO3\CMS\SysNote\Hook; */ use TYPO3\CMS\Core\Utility\GeneralUtility; +use TYPO3\CMS\Recordlist\Controller\RecordListController; use TYPO3\CMS\SysNote\Controller\NoteController; use TYPO3\CMS\SysNote\Domain\Repository\SysNoteRepository; @@ -28,10 +29,10 @@ class RecordListHook * Add sys_notes as additional content to the header of the list module * * @param array $params - * @param \TYPO3\CMS\Recordlist\RecordList $parentObject + * @param RecordListController $parentObject * @return string */ - public function renderInHeader(array $params = [], \TYPO3\CMS\Recordlist\RecordList $parentObject) + public function renderInHeader(array $params = [], RecordListController $parentObject) { $controller = GeneralUtility::makeInstance(NoteController::class); return $controller->listAction($parentObject->id, SysNoteRepository::SYS_NOTE_POSITION_TOP); @@ -41,10 +42,10 @@ class RecordListHook * Add sys_notes as additional content to the footer of the list module * * @param array $params - * @param \TYPO3\CMS\Recordlist\RecordList $parentObject + * @param RecordListController $parentObject * @return string */ - public function renderInFooter(array $params = [], \TYPO3\CMS\Recordlist\RecordList $parentObject) + public function renderInFooter(array $params = [], RecordListController $parentObject) { $controller = GeneralUtility::makeInstance(NoteController::class); return $controller->listAction($parentObject->id, SysNoteRepository::SYS_NOTE_POSITION_BOTTOM);