From 709bea92d042d8791c7a4e27683fad2d989fe025 Mon Sep 17 00:00:00 2001 From: Wouter Wolters Date: Tue, 18 Dec 2018 22:38:58 +0100 Subject: [PATCH] [!!!][TASK] Remove deprecated PHP classes from EXT:workspaces Resolves: #87204 Releases: master Change-Id: If697a2761c6c0eb42848c45dd17373d0e1dea5da Reviewed-on: https://review.typo3.org/59198 Tested-by: TYPO3com Reviewed-by: Christian Kuhn Tested-by: Christian Kuhn Reviewed-by: Georg Ringer Tested-by: Georg Ringer --- ...g-87193-DeprecatedFunctionalityRemoved.rst | 8 ++ .../ExtensionScanner/Php/ClassNameMatcher.php | 3 + .../Classes/Service/AutoPublishService.php | 117 ------------------ .../Classes/Task/AutoPublishTask.php | 43 ------- .../Classes/Task/CleanupPreviewLinkTask.php | 47 ------- .../Migrations/Code/ClassAliasMap.php | 1 - .../Private/Language/locallang_mod.xlf | 12 -- typo3/sysext/workspaces/ext_localconf.php | 16 --- 8 files changed, 11 insertions(+), 236 deletions(-) delete mode 100644 typo3/sysext/workspaces/Classes/Service/AutoPublishService.php delete mode 100644 typo3/sysext/workspaces/Classes/Task/AutoPublishTask.php delete mode 100644 typo3/sysext/workspaces/Classes/Task/CleanupPreviewLinkTask.php diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-87193-DeprecatedFunctionalityRemoved.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-87193-DeprecatedFunctionalityRemoved.rst index 9fa64a60bc44..1517c7f7b288 100644 --- a/typo3/sysext/core/Documentation/Changelog/master/Breaking-87193-DeprecatedFunctionalityRemoved.rst +++ b/typo3/sysext/core/Documentation/Changelog/master/Breaking-87193-DeprecatedFunctionalityRemoved.rst @@ -15,6 +15,9 @@ The following PHP classes that have been previously deprecated for v9 have been * :php:`TYPO3\CMS\Core\Resource\Utility\BackendUtility` * :php:`TYPO3\CMS\Core\Utility\ClientUtility` * :php:`TYPO3\CMS\Core\Utility\PhpOptionsUtility` +* :php:`TYPO3\CMS\Workspaces\Service\AutoPublishService` +* :php:`TYPO3\CMS\Workspaces\Task\AutoPublishTask` +* :php:`TYPO3\CMS\Workspaces\Task\CleanupPreviewLinkTask` The following PHP class methods that have been previously deprecated for v9 have been removed: @@ -42,6 +45,11 @@ The following class properties have changed visibility: * :php:`TYPO3\CMS\Core\Charset\CharsetConverter->toASCII` changed from public to protected * :php:`TYPO3\CMS\Core\Charset\CharsetConverter->twoByteSets` changed from public to protected +The following scheduler tasks have been removed: + +* EXT:workspaces CleanupPreviewLinkTask +* EXT:workspaces AutoPublishTask + Impact ====== diff --git a/typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php b/typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php index e899c9584e3c..e8f808da56ac 100644 --- a/typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php +++ b/typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php @@ -820,16 +820,19 @@ return [ 'TYPO3\CMS\Workspaces\Service\AutoPublishService' => [ 'restFiles' => [ 'Deprecation-86001-WorkspacesTasksMigratedToSymfonyCommands.rst', + 'Breaking-87193-DeprecatedFunctionalityRemoved.rst', ], ], 'TYPO3\CMS\Workspaces\Task\AutoPublishTask' => [ 'restFiles' => [ 'Deprecation-86001-WorkspacesTasksMigratedToSymfonyCommands.rst', + 'Breaking-87193-DeprecatedFunctionalityRemoved.rst', ], ], 'TYPO3\CMS\Workspaces\Task\CleanupPreviewLinkTask' => [ 'restFiles' => [ 'Deprecation-86001-WorkspacesTasksMigratedToSymfonyCommands.rst', + 'Breaking-87193-DeprecatedFunctionalityRemoved.rst', ], ], 'TYPO3\CMS\Extensionmanager\Command\ExtensionCommandController' => [ diff --git a/typo3/sysext/workspaces/Classes/Service/AutoPublishService.php b/typo3/sysext/workspaces/Classes/Service/AutoPublishService.php deleted file mode 100644 index 71fda9cb15f1..000000000000 --- a/typo3/sysext/workspaces/Classes/Service/AutoPublishService.php +++ /dev/null @@ -1,117 +0,0 @@ -user['admin']; - $GLOBALS['BE_USER']->user['admin'] = 1; - - // Select all workspaces that needs to be published / unpublished: - $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('sys_workspace'); - $queryBuilder->getRestrictions() - ->removeAll() - ->add(GeneralUtility::makeInstance(DeletedRestriction::class)); - - $result = $queryBuilder - ->select('uid', 'swap_modes', 'publish_time', 'unpublish_time') - ->from('sys_workspace') - ->where( - $queryBuilder->expr()->eq( - 'pid', - $queryBuilder->createNamedParameter(0, \PDO::PARAM_INT) - ), - $queryBuilder->expr()->orX( - $queryBuilder->expr()->andX( - $queryBuilder->expr()->neq( - 'publish_time', - $queryBuilder->createNamedParameter(0, \PDO::PARAM_INT) - ), - $queryBuilder->expr()->lte( - 'publish_time', - $queryBuilder->createNamedParameter($GLOBALS['EXEC_TIME'], \PDO::PARAM_INT) - ) - ), - $queryBuilder->expr()->andX( - $queryBuilder->expr()->eq( - 'publish_time', - $queryBuilder->createNamedParameter(0, \PDO::PARAM_INT) - ), - $queryBuilder->expr()->neq( - 'unpublish_time', - $queryBuilder->createNamedParameter(0, \PDO::PARAM_INT) - ), - $queryBuilder->expr()->lte( - 'unpublish_time', - $queryBuilder->createNamedParameter($GLOBALS['EXEC_TIME'], \PDO::PARAM_INT) - ) - ) - ) - ) - ->execute(); - - $workspaceService = GeneralUtility::makeInstance(WorkspaceService::class); - while ($rec = $result->fetch()) { - // First, clear start/end time so it doesn't get select once again: - $fieldArray = $rec['publish_time'] != 0 - ? ['publish_time' => 0] - : ['unpublish_time' => 0]; - - GeneralUtility::makeInstance(ConnectionPool::class) - ->getConnectionForTable('sys_workspace') - ->update( - 'sys_workspace', - $fieldArray, - ['uid' => (int)$rec['uid']] - ); - - // Get CMD array: - $cmd = $workspaceService->getCmdArrayForPublishWS($rec['uid'], $rec['swap_modes'] == 1); - // $rec['swap_modes']==1 means that auto-publishing will swap versions, not just publish and empty the workspace. - // Execute CMD array: - $tce = GeneralUtility::makeInstance(DataHandler::class); - $tce->start([], $cmd); - $tce->process_cmdmap(); - } - // Restore admin status - $GLOBALS['BE_USER']->user['admin'] = $currentAdminStatus; - } -} diff --git a/typo3/sysext/workspaces/Classes/Task/AutoPublishTask.php b/typo3/sysext/workspaces/Classes/Task/AutoPublishTask.php deleted file mode 100644 index 570c6b05244e..000000000000 --- a/typo3/sysext/workspaces/Classes/Task/AutoPublishTask.php +++ /dev/null @@ -1,43 +0,0 @@ -autoPublishWorkspaces(); - // There's no feedback from the publishing process, - // so there can't be any failure. - // @todo This could certainly be improved. - return true; - } -} diff --git a/typo3/sysext/workspaces/Classes/Task/CleanupPreviewLinkTask.php b/typo3/sysext/workspaces/Classes/Task/CleanupPreviewLinkTask.php deleted file mode 100644 index c92d79bebc4b..000000000000 --- a/typo3/sysext/workspaces/Classes/Task/CleanupPreviewLinkTask.php +++ /dev/null @@ -1,47 +0,0 @@ -getQueryBuilderForTable('sys_preview'); - $queryBuilder - ->delete('sys_preview') - ->where( - $queryBuilder->expr()->lt( - 'endtime', - $queryBuilder->createNamedParameter($GLOBALS['EXEC_TIME'], \PDO::PARAM_INT) - ) - ) - ->execute(); - - return true; - } -} diff --git a/typo3/sysext/workspaces/Migrations/Code/ClassAliasMap.php b/typo3/sysext/workspaces/Migrations/Code/ClassAliasMap.php index 60fa1c84b7c0..c5b9ffe53c11 100644 --- a/typo3/sysext/workspaces/Migrations/Code/ClassAliasMap.php +++ b/typo3/sysext/workspaces/Migrations/Code/ClassAliasMap.php @@ -10,6 +10,5 @@ return [ 'TYPO3\\CMS\\Version\\Dependency\\ReferenceEntity' => \TYPO3\CMS\Workspaces\Dependency\ReferenceEntity::class, 'TYPO3\\CMS\\Version\\Hook\\DataHandlerHook' => \TYPO3\CMS\Workspaces\Hook\DataHandlerHook::class, 'TYPO3\\CMS\\Version\\Hook\\PreviewHook' => \TYPO3\CMS\Workspaces\Preview\PreviewUriBuilder::class, - 'TYPO3\\CMS\\Version\\Task\\AutoPublishTask' => \TYPO3\CMS\Workspaces\Task\AutoPublishTask::class, 'TYPO3\\CMS\\Version\\Utility\\WorkspacesUtility' => \TYPO3\CMS\Workspaces\Service\WorkspaceService::class, ]; diff --git a/typo3/sysext/workspaces/Resources/Private/Language/locallang_mod.xlf b/typo3/sysext/workspaces/Resources/Private/Language/locallang_mod.xlf index 32dbf3326be5..5f7f3f204b56 100644 --- a/typo3/sysext/workspaces/Resources/Private/Language/locallang_mod.xlf +++ b/typo3/sysext/workspaces/Resources/Private/Language/locallang_mod.xlf @@ -12,18 +12,6 @@ Create and handle versioning workflows - - Workspaces auto-publication (outdated, use the Symfony Command) - - - This tasks checks any workspace that has a publication date set in the past and automatically publishes it. - - - Workspaces cleanup preview links (outdated, use the Symfony Command) - - - This task delete old preview links - Ready to publish diff --git a/typo3/sysext/workspaces/ext_localconf.php b/typo3/sysext/workspaces/ext_localconf.php index a863934c7938..6c7fdb51be72 100644 --- a/typo3/sysext/workspaces/ext_localconf.php +++ b/typo3/sysext/workspaces/ext_localconf.php @@ -8,22 +8,6 @@ tx_version.workspaces.stageNotificationEmail.message = LLL:EXT:workspaces/Resour # tx_version.workspaces.stageNotificationEmail.additionalHeaders = '); -// Register the autopublishing task -// This will be removed in favor of the CLI command workspace:autopublish -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Workspaces\Task\AutoPublishTask::class] = [ - 'extension' => 'workspaces', - 'title' => 'LLL:EXT:workspaces/Resources/Private/Language/locallang_mod.xlf:autopublishTask.name', - 'description' => 'LLL:EXT:workspaces/Resources/Private/Language/locallang_mod.xlf:autopublishTask.description' -]; - -// Register the cleanup preview links task -// This will be removed in favor of the CLI command cleanup:previewlinks -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Workspaces\Task\CleanupPreviewLinkTask::class] = [ - 'extension' => 'workspaces', - 'title' => 'LLL:EXT:workspaces/Resources/Private/Language/locallang_mod.xlf:cleanupPreviewLinkTask.name', - 'description' => 'LLL:EXT:workspaces/Resources/Private/Language/locallang_mod.xlf:cleanupPreviewLinkTask.description' -]; - // register the hook to actually do the work within DataHandler $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass']['workspaces'] = \TYPO3\CMS\Workspaces\Hook\DataHandlerHook::class; $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['moveRecordClass']['version'] = \TYPO3\CMS\Workspaces\Hook\DataHandlerHook::class; -- 2.20.1