[!!!][TASK] Remove deprecated PHP classes from EXT:workspaces 98/59198/5
authorWouter Wolters <typo3@wouterwolters.nl>
Tue, 18 Dec 2018 21:38:58 +0000 (22:38 +0100)
committerGeorg Ringer <georg.ringer@gmail.com>
Wed, 19 Dec 2018 05:18:09 +0000 (06:18 +0100)
Resolves: #87204
Releases: master
Change-Id: If697a2761c6c0eb42848c45dd17373d0e1dea5da
Reviewed-on: https://review.typo3.org/59198
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
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/ClassNameMatcher.php
typo3/sysext/workspaces/Classes/Service/AutoPublishService.php [deleted file]
typo3/sysext/workspaces/Classes/Task/AutoPublishTask.php [deleted file]
typo3/sysext/workspaces/Classes/Task/CleanupPreviewLinkTask.php [deleted file]
typo3/sysext/workspaces/Migrations/Code/ClassAliasMap.php
typo3/sysext/workspaces/Resources/Private/Language/locallang_mod.xlf
typo3/sysext/workspaces/ext_localconf.php

index 9fa64a6..1517c7f 100644 (file)
@@ -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
 ======
 
index e899c95..e8f808d 100644 (file)
@@ -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 (file)
index 71fda9c..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-<?php
-namespace TYPO3\CMS\Workspaces\Service;
-
-/*
- * 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!
- */
-
-use TYPO3\CMS\Core\Database\ConnectionPool;
-use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction;
-use TYPO3\CMS\Core\DataHandling\DataHandler;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-
-/**
- * Automatic publishing of workspaces.
- *
- * @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0. This job is a one-time functionality now built into the "autopublish" functionality.
- */
-class AutoPublishService
-{
-    public function __construct()
-    {
-        trigger_error('AutoPublishService will be removed in TYPO3 v10.0. Use the symfony command "workspaces:autopublish" instead.', E_USER_DEPRECATED);
-    }
-
-    /**
-     * This method is called by the Scheduler task that triggers
-     * the autopublication process
-     * It searches for workspaces whose publication date is in the past
-     * and publishes them
-     * @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0.
-     */
-    public function autoPublishWorkspaces()
-    {
-        // Temporarily set admin rights
-        // @todo once workspaces are cleaned up a better solution should be implemented
-        $currentAdminStatus = $GLOBALS['BE_USER']->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 (file)
index 570c6b0..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-<?php
-namespace TYPO3\CMS\Workspaces\Task;
-
-/*
- * 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!
- */
-
-/**
- * This class provides a wrapper around the autopublication
- * mechanism of workspaces, as a Scheduler task
- *
- * @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0.
- */
-class AutoPublishTask extends \TYPO3\CMS\Scheduler\Task\AbstractTask
-{
-    /**
-     * Method executed from the Scheduler.
-     * Call on the workspace logic to publish workspaces whose publication date
-     * is in the past
-     *
-     * @return bool
-     */
-    public function execute()
-    {
-        trigger_error('This scheduler task is not in use anymore, please re-create the task within TYPO3 Scheduler by using the symfony command "Workspace Auto-Publish".', E_USER_DEPRECATED);
-        $autopubObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Workspaces\Service\AutoPublishService::class);
-        // Publish the workspaces that need to be
-        $autopubObj->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 (file)
index c92d79b..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-<?php
-namespace TYPO3\CMS\Workspaces\Task;
-
-/*
- * 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!
- */
-use TYPO3\CMS\Core\Database\ConnectionPool;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-
-/**
- * This class provides a task to cleanup ol preview links.
- * @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0.
- */
-class CleanupPreviewLinkTask extends \TYPO3\CMS\Scheduler\Task\AbstractTask
-{
-    /**
-     * Cleanup old preview links.
-     * endtime < $GLOBALS['EXEC_TIME']
-     *
-     * @return bool
-     */
-    public function execute()
-    {
-        trigger_error('This scheduler task is not in use anymore, please re-create the task within TYPO3 Scheduler by using the symfony command "Cleanup Preview Links".', E_USER_DEPRECATED);
-        $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('sys_preview');
-        $queryBuilder
-            ->delete('sys_preview')
-            ->where(
-                $queryBuilder->expr()->lt(
-                    'endtime',
-                    $queryBuilder->createNamedParameter($GLOBALS['EXEC_TIME'], \PDO::PARAM_INT)
-                )
-            )
-            ->execute();
-
-        return true;
-    }
-}
index 60fa1c8..c5b9ffe 100644 (file)
@@ -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,
 ];
index 32dbf33..5f7f3f2 100644 (file)
                        <trans-unit id="mlang_labels_tablabel">
                                <source>Create and handle versioning workflows</source>
                        </trans-unit>
-                       <trans-unit id="autopublishTask.name">
-                               <source>Workspaces auto-publication (outdated, use the Symfony Command)</source>
-                       </trans-unit>
-                       <trans-unit id="autopublishTask.description">
-                               <source>This tasks checks any workspace that has a publication date set in the past and automatically publishes it.</source>
-                       </trans-unit>
-                       <trans-unit id="cleanupPreviewLinkTask.name">
-                               <source>Workspaces cleanup preview links (outdated, use the Symfony Command)</source>
-                       </trans-unit>
-                       <trans-unit id="cleanupPreviewLinkTask.description">
-                               <source>This task delete old preview links</source>
-                       </trans-unit>
                        <trans-unit id="stage_ready_to_publish">
                                <source>Ready to publish</source>
                        </trans-unit>
index a863934..6c7fdb5 100644 (file)
@@ -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;