[!!!][TASK] Remove deprecated code from EXT:recordlist 57/59357/6
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Mon, 7 Jan 2019 15:06:07 +0000 (16:06 +0100)
committerGeorg Ringer <georg.ringer@gmail.com>
Tue, 8 Jan 2019 18:24:44 +0000 (19:24 +0100)
Resolves: #87354
Related: #87193
Releases: master
Change-Id: Ib1ccf6fdb7c69257716665c58e75b2295dc5f0b1
Reviewed-on: https://review.typo3.org/59357
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
typo3/sysext/core/Documentation/Changelog/master/Breaking-87193-DeprecatedFunctionalityRemoved.rst
typo3/sysext/install/Configuration/ExtensionScanner/Php/ArrayDimensionMatcher.php
typo3/sysext/install/Configuration/ExtensionScanner/Php/PropertyProtectedMatcher.php
typo3/sysext/recordlist/Classes/Controller/RecordListController.php
typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php

index 39e5f8d..d10b103 100644 (file)
@@ -458,6 +458,7 @@ The following methods changed signature according to previous deprecations in v9
 * :php:`TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->__construct()` - Fourth argument unused
 * :php:`TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->calculateLinkVars()` - First argument mandatory
 * :php:`TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->preparePageContentGeneration()` - First argument mandatory
+* :php:`TYPO3\CMS\Recordlist\Controller\RecordListController->main()` - First argument mandatory
 
 
 
@@ -559,6 +560,9 @@ The following public class properties have been dropped:
 * :php:`TYPO3\CMS\Extbase\Validation\ValidatorResolver->parseValidatorOptions`
 * :php:`TYPO3\CMS\Extbase\Validation\ValidatorResolver->unquoteString`
 * :php:`TYPO3\CMS\Extbase\Validation\ValidatorResolver->getMethodValidateAnnotations`
+* :php:`TYPO3\CMS\Recordlist\Controller\RecordListController->doc`
+* :php:`TYPO3\CMS\Recordlist\Controller\RecordListController->imagemode`
+* :php:`TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList->newWizards`
 
 
 
@@ -663,6 +667,11 @@ The following class methods have changed visibility:
 * :php:`TYPO3\CMS\Impexp\Controller\ImportExportController->makeConfigurationForm()` changed from public to protected
 * :php:`TYPO3\CMS\Impexp\Controller\ImportExportController->makeSaveForm()` changed from public to protected
 * :php:`TYPO3\CMS\Linkvalidator\Report\LinkValidatorReport->extObjContent()` changed from public to protected
+* :php:`TYPO3\CMS\Recordlist\Controller\RecordListController->init()` changed from public to protected
+* :php:`TYPO3\CMS\Recordlist\Controller\RecordListController->menuConfig()` changed from public to protected
+* :php:`TYPO3\CMS\Recordlist\Controller\RecordListController->clearCache()` changed from public to protected
+* :php:`TYPO3\CMS\Recordlist\Controller\RecordListController->main()` changed from public to protected
+* :php:`TYPO3\CMS\Recordlist\Controller\RecordListController->getModuleTemplate()` changed from public to protected
 * :php:`TYPO3\CMS\Scheduler\Controller\SchedulerModuleController->addMessage()` changed from public to protected
 * :php:`TYPO3\CMS\Taskcenter\Controller\TaskModuleController->menuConfig()` changed from public to protected
 * :php:`TYPO3\CMS\Taskcenter\Controller\TaskModuleController->mergeExternalItems()` changed from public to protected
@@ -878,6 +887,21 @@ The following class properties have changed visibility:
 * :php:`TYPO3\CMS\Linkvalidator\Report\LinkValidatorReport->extClassConf` changed from public to protected
 * :php:`TYPO3\CMS\Linkvalidator\Report\LinkValidatorReport->localLangFile` changed from public to protected
 * :php:`TYPO3\CMS\Linkvalidator\Report\LinkValidatorReport->extObj` changed from public to protected
+* :php:`TYPO3\CMS\Recordlist\Controller\RecordListController->id` changed from public to protected
+* :php:`TYPO3\CMS\Recordlist\Controller\RecordListController->pointer` changed from public to protected
+* :php:`TYPO3\CMS\Recordlist\Controller\RecordListController->table` changed from public to protected
+* :php:`TYPO3\CMS\Recordlist\Controller\RecordListController->search_field` changed from public to protected
+* :php:`TYPO3\CMS\Recordlist\Controller\RecordListController->search_levels` changed from public to protected
+* :php:`TYPO3\CMS\Recordlist\Controller\RecordListController->showLimit` changed from public to protected
+* :php:`TYPO3\CMS\Recordlist\Controller\RecordListController->returnUrl` changed from public to protected
+* :php:`TYPO3\CMS\Recordlist\Controller\RecordListController->clear_cache` changed from public to protected
+* :php:`TYPO3\CMS\Recordlist\Controller\RecordListController->cmd` changed from public to protected
+* :php:`TYPO3\CMS\Recordlist\Controller\RecordListController->cmd_table` changed from public to protected
+* :php:`TYPO3\CMS\Recordlist\Controller\RecordListController->perms_clause` changed from public to protected
+* :php:`TYPO3\CMS\Recordlist\Controller\RecordListController->pageinfo` changed from public to protected
+* :php:`TYPO3\CMS\Recordlist\Controller\RecordListController->MOD_MENU` changed from public to protected
+* :php:`TYPO3\CMS\Recordlist\Controller\RecordListController->content` changed from public to protected
+* :php:`TYPO3\CMS\Recordlist\Controller\RecordListController->body` changed from public to protected
 * :php:`TYPO3\CMS\Scheduler\Controller\SchedulerModuleController->CMD` changed from public to protected
 * :php:`TYPO3\CMS\Setup\Controller\SetupModuleController->OLD_BE_USER` changed from public to protected
 * :php:`TYPO3\CMS\Setup\Controller\SetupModuleController->MOD_MENU` changed from public to protected
@@ -1056,6 +1080,13 @@ The following hooks have been removed:
 * :php:`$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['tslib_fe-PostProc']`
 * :php:`$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_parsehtml_proc.php']['modifyParams_LinksDb_PostProc']`
 * :php:`$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_parsehtml_proc.php']['modifyParams_LinksRte_PostProc']`
+* :php:`$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList']['buildQueryParameters']`
+
+
+The following hooks don't pass the class reference anymore:
+
+* :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']`
 
 The following feature is now always enabled:
 
index be48f98..1b1b024 100644 (file)
@@ -156,6 +156,7 @@ return [
     '$GLOBALS[\'TYPO3_CONF_VARS\'][\'SC_OPTIONS\'][\'TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList\'][\'buildQueryParameters\']' => [
         'restFiles' => [
             'Deprecation-83740-CleanupOfAbstractRecordListBreaksHook.rst',
+            'Breaking-87193-DeprecatedFunctionalityRemoved.rst',
         ],
     ],
     '$GLOBALS[\'TYPO3_CONF_VARS\'][\'SC_OPTIONS\'][\'tslib/class.tslib_adminpanel.php\'][\'extendAdminPanel\']' => [
index 0ebf693..8828c93 100644 (file)
@@ -609,6 +609,7 @@ return [
     'TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList->newWizards' => [
         'restFiles' => [
             'Deprecation-84463-PageTsConfigOptionModweb_listnewWizardsDropped.rst',
+            'Breaking-87193-DeprecatedFunctionalityRemoved.rst',
         ],
     ],
     'TYPO3\CMS\Core\Authentication\BackendUserAuthentication->TSdataArray' => [
index 35082ed..01f1185 100644 (file)
@@ -19,12 +19,9 @@ 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;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
-use TYPO3\CMS\Core\Compatibility\PublicMethodDeprecationTrait;
-use TYPO3\CMS\Core\Compatibility\PublicPropertyDeprecationTrait;
 use TYPO3\CMS\Core\Database\ConnectionPool;
 use TYPO3\CMS\Core\Database\Query\Restriction\BackendWorkspaceRestriction;
 use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction;
@@ -49,43 +46,6 @@ use TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList;
  */
 class RecordListController
 {
-    use PublicPropertyDeprecationTrait;
-    use PublicMethodDeprecationTrait;
-
-    /**
-     * @var array
-     */
-    private $deprecatedPublicProperties = [
-        'id' => 'Using RecordListController::$id is deprecated and will not be possible anymore in TYPO3 v10.0.',
-        'pointer' => 'Using RecordListController::$pointer is deprecated and will not be possible anymore in TYPO3 v10.0.',
-        'table' => 'Using RecordListController::$table is deprecated and will not be possible anymore in TYPO3 v10.0.',
-        'search_field' => 'Using RecordListController::$search_field is deprecated and will not be possible anymore in TYPO3 v10.0.',
-        'search_levels' => 'Using RecordListController::$search_levels is deprecated and will not be possible anymore in TYPO3 v10.0.',
-        'showLimit' => 'Using RecordListController::$showLimit is deprecated and will not be possible anymore in TYPO3 v10.0.',
-        'returnUrl' => 'Using RecordListController::$returnUrl is deprecated and will not be possible anymore in TYPO3 v10.0.',
-        'clear_cache' => 'Using RecordListController::$clear_cache is deprecated and will not be possible anymore in TYPO3 v10.0.',
-        'cmd' => 'Using RecordListController::$cmd is deprecated and will not be possible anymore in TYPO3 v10.0.',
-        'cmd_table' => 'Using RecordListController::$cmd_table is deprecated and will not be possible anymore in TYPO3 v10.0.',
-        'perms_clause' => 'Using RecordListController::$perms_clause is deprecated and will not be possible anymore in TYPO3 v10.0.',
-        'pageinfo' => 'Using RecordListController::$pageinfo is deprecated and will not be possible anymore in TYPO3 v10.0.',
-        'MOD_MENU' => 'Using RecordListController::$MOD_MENU is deprecated and will not be possible anymore in TYPO3 v10.0.',
-        'content' => 'Using RecordListController::$content is deprecated and will not be possible anymore in TYPO3 v10.0.',
-        'body' => 'Using RecordListController::$body is deprecated and will not be possible anymore in TYPO3 v10.0.',
-        'imagemode' => 'Using RecordListController::$imagemode is deprecated, property will be removed in TYPO3 v10.0.',
-        'doc' => 'Using RecordListController::$doc is deprecated, property will be removed in TYPO3 v10.0.',
-    ];
-
-    /**
-     * @var array
-     */
-    private $deprecatedPublicMethods = [
-        'init' => 'Using RecordListController::init() is deprecated and will not be possible anymore in TYPO3 v10.0.',
-        'menuConfig' => 'Using RecordListController::menuConfig() is deprecated and will not be possible anymore in TYPO3 v10.0.',
-        'clearCache' => 'Using RecordListController::clearCache() is deprecated and will not be possible anymore in TYPO3 v10.0.',
-        'main' => 'Using RecordListController::main() is deprecated and will not be possible anymore in TYPO3 v10.0.',
-        'getModuleTemplate' => 'Using RecordListController::getModuleTemplate() is deprecated and will not be possible anymore in TYPO3 v10.0.',
-    ];
-
     /**
      * Page Id for which to make the listing
      *
@@ -101,14 +61,6 @@ class RecordListController
     protected $pointer;
 
     /**
-     * Thumbnails or not
-     *
-     * @var string
-     * @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0.
-     */
-    protected $imagemode;
-
-    /**
      * Which table to make extended listing for
      *
      * @var string
@@ -187,14 +139,6 @@ class RecordListController
     protected $pageinfo;
 
     /**
-     * Document template object
-     *
-     * @var DocumentTemplate
-     * @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0.
-     */
-    protected $doc;
-
-    /**
      * Menu configuration
      *
      * @var string[]
@@ -273,8 +217,6 @@ class RecordListController
         // GPvars:
         $this->id = (int)GeneralUtility::_GP('id');
         $this->pointer = GeneralUtility::_GP('pointer');
-        // @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0.
-        $this->imagemode = GeneralUtility::_GP('imagemode');
         $this->table = GeneralUtility::_GP('table');
         $this->search_field = GeneralUtility::_GP('search_field');
         $this->search_levels = (int)GeneralUtility::_GP('search_levels');
@@ -324,26 +266,14 @@ class RecordListController
      *
      * @param ServerRequestInterface $request
      */
-    protected function main(ServerRequestInterface $request = null)
+    protected function main(ServerRequestInterface $request)
     {
-        if ($request === null) {
-            // Missing argument? This method must have been called from outside.
-            // Method will be protected and $request mandatory in TYPO3 v10.0, giving core freedom to move stuff around
-            // New v10 signature: "protected function main(ServerRequestInterface $request)"
-            // @deprecated since TYPO3 v9, method argument $request will be set to mandatory
-            $request = $GLOBALS['TYPO3_REQUEST'];
-        }
-
         $backendUser = $this->getBackendUserAuthentication();
         $lang = $this->getLanguageService();
         // Loading current page record and checking access:
         $this->pageinfo = BackendUtility::readPageAccess($this->id, $this->perms_clause);
         $access = is_array($this->pageinfo);
 
-        // Start document template object
-        // @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0. Instantiation will be removed.
-        $this->doc = GeneralUtility::makeInstance(DocumentTemplate::class);
-
         $this->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Backend/AjaxDataHandler');
         $calcPerms = $backendUser->calcPerms($this->pageinfo);
         $userCanEditPage = $calcPerms & Permission::PAGE_EDIT && !empty($this->id) && ($backendUser->isAdmin() || (int)$this->pageinfo['editlock'] === 0);
@@ -525,8 +455,8 @@ class RecordListController
             $params = [
                 'request' => $request,
             ];
-            // @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0: Handing over $this as second constructor argument will be changed to $null = null;
-            $this->body .= GeneralUtility::callUserFunction($hook, $params, $this);
+            $null = null;
+            $this->body .= GeneralUtility::callUserFunction($hook, $params, $null);
         }
 
         $this->moduleTemplate->setTitle($title);
@@ -615,8 +545,8 @@ class RecordListController
             $params = [
                 'request' => $request,
             ];
-            // @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0: Handing over $this as second constructor argument will be changed to $null = null;
-            $this->body .= GeneralUtility::callUserFunction($hook, $params, $this);
+            $null = null;
+            $this->body .= GeneralUtility::callUserFunction($hook, $params, $null);
         }
         // Setting up the buttons for docheader
         $dblist->getDocHeaderButtons($this->moduleTemplate);
@@ -658,8 +588,6 @@ class RecordListController
         $this->site = $request->getAttribute('site');
         $this->siteLanguages = $this->site->getAvailableLanguages($this->getBackendUserAuthentication(), false, (int)$this->id);
         BackendUtility::lockRecords();
-        // @deprecated  since TYPO3 v9, will be removed in TYPO3 v10.0. Can be removed along with $this->doc.
-        $GLOBALS['SOBE'] = $this;
         $this->init();
         $this->clearCache();
         $this->main($request);
index 591f94e..0ada2cd 100644 (file)
@@ -24,7 +24,6 @@ use TYPO3\CMS\Backend\Tree\View\PageTreeView;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
 use TYPO3\CMS\Core\Cache\CacheManager;
-use TYPO3\CMS\Core\Compatibility\PublicPropertyDeprecationTrait;
 use TYPO3\CMS\Core\Database\Connection;
 use TYPO3\CMS\Core\Database\ConnectionPool;
 use TYPO3\CMS\Core\Database\Query\QueryBuilder;
@@ -55,15 +54,6 @@ use TYPO3\CMS\Frontend\Page\PageRepository;
  */
 class DatabaseRecordList
 {
-    use PublicPropertyDeprecationTrait;
-
-    /**
-     * @var array
-     */
-    protected $deprecatedPublicProperties = [
-        'newWizards' => 'Using $newWizards of class DatabaseRecordList from outside is discouraged, property will be removed in TYPO3 v10.0.',
-    ];
-
     // *********
     // External:
     // *********
@@ -85,16 +75,6 @@ class DatabaseRecordList
     public $deniedNewTables = [];
 
     /**
-     * If TRUE, the control panel will contain links to the create-new wizards for
-     * pages and tt_content elements (normally, the link goes to just creating a new
-     * element without the wizards!).
-     *
-     * @var bool
-     * @deprecated and unused since TYPO3 v9, will be removed in TYPO3 v10.0
-     */
-    public $newWizards = false;
-
-    /**
      * If TRUE, will disable the rendering of clipboard + control panels.
      *
      * @var bool
@@ -3357,24 +3337,6 @@ class DatabaseRecordList
         }
 
         $hookName = DatabaseRecordList::class;
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][$hookName]['buildQueryParameters'])) {
-            // @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0, the modifyQuery hook should be used instead.
-            trigger_error('The hook ($GLOBALS[\'TYPO3_CONF_VARS\'][\'SC_OPTIONS\'][' . $hookName . '][\'buildQueryParameters\']) will be removed in TYPO3 v10.0, the modifyQuery hook should be used instead.', E_USER_DEPRECATED);
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][$hookName]['buildQueryParameters'] as $className) {
-                $hookObject = GeneralUtility::makeInstance($className);
-                if (method_exists($hookObject, 'buildQueryParametersPostProcess')) {
-                    $hookObject->buildQueryParametersPostProcess(
-                        $parameters,
-                        $table,
-                        $pageId,
-                        $additionalConstraints,
-                        $fieldList,
-                        $this,
-                        $queryBuilder
-                    );
-                }
-            }
-        }
         foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][$hookName]['modifyQuery'] ?? [] as $className) {
             $hookObject = GeneralUtility::makeInstance($className);
             if (method_exists($hookObject, 'modifyQuery')) {
@@ -3389,37 +3351,6 @@ class DatabaseRecordList
             }
         }
 
-        // array_unique / array_filter used to eliminate empty and duplicate constraints
-        // the array keys are eliminated by this as well to facilitate argument unpacking
-        // when used with the querybuilder.
-        // @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0
-        if (!empty($parameters['where'])) {
-            $parameters['where'] = array_unique(array_filter(array_values($parameters['where'])));
-        }
-        if (!empty($parameters['where'])) {
-            $this->logDeprecation('where');
-            $queryBuilder->where(...$parameters['where']);
-        }
-        if (!empty($parameters['orderBy'])) {
-            $this->logDeprecation('orderBy');
-            foreach ($parameters['orderBy'] as $fieldNameAndSorting) {
-                list($fieldName, $sorting) = $fieldNameAndSorting;
-                $queryBuilder->addOrderBy($fieldName, $sorting);
-            }
-        }
-        if (!empty($parameters['firstResult']) && $parameters['firstResult'] !== $this->firstElementNumber) {
-            $this->logDeprecation('firstResult');
-            $queryBuilder->setFirstResult((int)$parameters['firstResult']);
-        }
-        if (!empty($parameters['maxResults']) && $parameters['maxResults'] !== $this->iLimit) {
-            $this->logDeprecation('maxResults');
-            $queryBuilder->setMaxResults((int)$parameters['maxResults']);
-        }
-        if (!empty($parameters['groupBy'])) {
-            $this->logDeprecation('groupBy');
-            $queryBuilder->groupBy($parameters['groupBy']);
-        }
-
         return $queryBuilder;
     }
 
@@ -4075,17 +4006,6 @@ class DatabaseRecordList
     }
 
     /**
-     * Method used to log deprecated usage of old buildQueryParametersPostProcess hook arguments
-     *
-     * @param string $index
-     * @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0 - see method usages
-     */
-    protected function logDeprecation(string $index)
-    {
-        trigger_error('[index: ' . $index . '] $parameters in "buildQueryParameters"-Hook will be removed in TYPO3 v10.0, use $queryBuilder instead.', E_USER_DEPRECATED);
-    }
-
-    /**
      * @return BackendUserAuthentication
      */
     protected function getBackendUserAuthentication()