[!!!][TASK] Remove auto-unpublishing of workspaces 82/60482/3
authorBenni Mack <benni@typo3.org>
Tue, 16 Apr 2019 03:46:11 +0000 (05:46 +0200)
committerGeorg Ringer <georg.ringer@gmail.com>
Fri, 19 Apr 2019 19:31:15 +0000 (21:31 +0200)
Workspaces had a field called "unpublish_time" which was not accessible
for TYPO3 Core since TYPO3 4.5. The field was still processed, but never
in use due to side-effects.

The functionality has therefore been removed without substitution.

Resolves: #81950
Releases: master
Change-Id: I6d79b78246103ef485a4d9d0de791b03d10d08a5
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/60482
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
typo3/sysext/core/Documentation/Changelog/master/Breaking-81950-RemoveLeftoverWorkspacesUnpublishingFunctionality.rst [new file with mode: 0644]
typo3/sysext/core/Resources/Private/Language/locallang_tca.xlf
typo3/sysext/workspaces/Classes/Command/AutoPublishCommand.php
typo3/sysext/workspaces/Configuration/TCA/sys_workspace.php
typo3/sysext/workspaces/ext_tables.sql

diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-81950-RemoveLeftoverWorkspacesUnpublishingFunctionality.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-81950-RemoveLeftoverWorkspacesUnpublishingFunctionality.rst
new file mode 100644 (file)
index 0000000..e785ca9
--- /dev/null
@@ -0,0 +1,41 @@
+.. include:: ../../Includes.txt
+
+========================================================================
+Breaking: #81950 - Remove leftover workspaces unpublishing functionality
+========================================================================
+
+See :issue:`81950`
+
+Description
+===========
+
+A property within workspaces for "unpublishing" published records has been disabled since TYPO3 4.5.
+
+This functionality allowed to restore a published workspace which was published at a given time, to revert the changes on another
+time, but had side-effects if changes were made between publishing and unpublishing.
+
+However, this functionality was not visible to TYPO3 out of the box, but only available with a possible third-party integration
+since TYPO3 4.5. The feature was therefore removed from TYPO3 Core.
+
+The (hidden) database field `sys_workspace.unpublish_time` was removed.
+
+
+Impact
+======
+
+Using the functionality will not work anymore, operating on the database with this field will result in a SQL error.
+
+
+Affected Installations
+======================
+
+Any installation using the workspace functionality with automatic publishing and a third-party extension for unpublishing.
+
+
+Migration
+=========
+
+If this feature is required for an installation, the field should be re-added by the third-party extension in TCA (which was missing)
+and the database which was using the functionality. On top, a custom auto-unpublishing CLI command should be created.
+
+.. index:: Database, NotScanned, ext:workspaces
\ No newline at end of file
index 7c2e0e9..16e6b72 100644 (file)
                        <trans-unit id="sys_workspace.publish_time">
                                <source>Publish</source>
                        </trans-unit>
-                       <trans-unit id="sys_workspace.unpublish_time">
-                               <source>Un-Publish</source>
-                       </trans-unit>
                        <trans-unit id="sys_workspace.freeze">
                                <source>Freeze Editing</source>
                        </trans-unit>
index 15cafe1..a85c775 100644 (file)
@@ -62,15 +62,11 @@ class AutoPublishCommand extends Command
         $affectedWorkspaces = 0;
         while ($workspaceRecord = $statement->fetch()) {
             // First, clear start/end time so it doesn't get selected once again
-            $fieldArray = (int)$workspaceRecord['publish_time'] !== 0
-                ? ['publish_time' => 0]
-                : ['unpublish_time' => 0];
-
             GeneralUtility::makeInstance(ConnectionPool::class)
                 ->getConnectionForTable('sys_workspace')
                 ->update(
                     'sys_workspace',
-                    $fieldArray,
+                    ['publish_time' => 0],
                     ['uid' => (int)$workspaceRecord['uid']]
                 );
 
@@ -106,38 +102,20 @@ class AutoPublishCommand extends Command
             ->add(GeneralUtility::makeInstance(DeletedRestriction::class));
 
         return $queryBuilder
-            ->select('uid', 'swap_modes', 'publish_time', 'unpublish_time')
+            ->select('uid', 'swap_modes', 'publish_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)
-                        )
-                    )
+                $queryBuilder->expr()->neq(
+                    'publish_time',
+                    $queryBuilder->createNamedParameter(0, \PDO::PARAM_INT)
+                ),
+                $queryBuilder->expr()->lte(
+                    'publish_time',
+                    $queryBuilder->createNamedParameter($GLOBALS['EXEC_TIME'], \PDO::PARAM_INT)
                 )
             )
             ->execute();
index c0c61b0..eb17fc9 100644 (file)
@@ -87,18 +87,6 @@ return [
                 'default' => 0,
             ]
         ],
-        'unpublish_time' => [
-            'label' => 'LLL:EXT:workspaces/Resources/Private/Language/locallang_db.xlf:sys_workspace.unpublish_time',
-            'config' => [
-                'type' => 'input',
-                'renderType' => 'inputDateTime',
-                'eval' => 'datetime,int',
-                'default' => 0,
-                'range' => [
-                    'upper' => mktime(0, 0, 0, 1, 1, 2038)
-                ]
-            ],
-        ],
         'freeze' => [
             'label' => 'LLL:EXT:workspaces/Resources/Private/Language/locallang_db.xlf:sys_workspace.freeze',
             'config' => [
index 0d737f6..03b5eb5 100644 (file)
@@ -20,7 +20,6 @@ CREATE TABLE sys_workspace (
        db_mountpoints varchar(255) DEFAULT '' NOT NULL,
        file_mountpoints varchar(255) DEFAULT '' NOT NULL,
        publish_time int(11) DEFAULT '0' NOT NULL,
-       unpublish_time int(11) DEFAULT '0' NOT NULL,
        freeze tinyint(3) DEFAULT '0' NOT NULL,
        live_edit tinyint(3) DEFAULT '0' NOT NULL,
        vtypes tinyint(3) DEFAULT '0' NOT NULL,