Skip to content

Commit

Permalink
[!!!][TASK] Remove deprecated code from EXT:recordlist
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
andreaskienast authored and georgringer committed Jan 8, 2019
1 parent a83df28 commit e909715
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 157 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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



Expand Down Expand Up @@ -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`



Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@
'$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\']' => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,7 @@
'TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList->newWizards' => [
'restFiles' => [
'Deprecation-84463-PageTsConfigOptionModweb_listnewWizardsDropped.rst',
'Breaking-87193-DeprecatedFunctionalityRemoved.rst',
],
],
'TYPO3\CMS\Core\Authentication\BackendUserAuthentication->TSdataArray' => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,9 @@
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;
Expand All @@ -49,43 +46,6 @@
*/
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
*
Expand All @@ -100,14 +60,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
*
Expand Down Expand Up @@ -186,14 +138,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
*
Expand Down Expand Up @@ -273,8 +217,6 @@ protected function init()
// 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');
Expand Down Expand Up @@ -324,26 +266,14 @@ protected function clearCache()
*
* @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);
Expand Down Expand Up @@ -525,8 +455,8 @@ function editList(table,idList) {
$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);
Expand Down Expand Up @@ -615,8 +545,8 @@ function editList(table,idList) {
$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);
Expand Down Expand Up @@ -658,8 +588,6 @@ public function mainAction(ServerRequestInterface $request): ResponseInterface
$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);
Expand Down
80 changes: 0 additions & 80 deletions typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
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;
Expand Down Expand Up @@ -55,15 +54,6 @@
*/
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:
// *********
Expand All @@ -84,16 +74,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.
*
Expand Down Expand Up @@ -3357,24 +3337,6 @@ protected function prepareQueryBuilder(
}

$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')) {
Expand All @@ -3389,37 +3351,6 @@ protected function prepareQueryBuilder(
}
}

// 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;
}

Expand Down Expand Up @@ -4074,17 +4005,6 @@ protected function addPageIdConstraint(string $tableName, QueryBuilder $queryBui
return $queryBuilder;
}

/**
* 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
*/
Expand Down

0 comments on commit e909715

Please sign in to comment.