[BUGFIX] Fix faulty move-placeholder processing with workspaces 64/42064/4
authorArtur Cichosz <a.cichosz@q3i.de>
Tue, 28 Jul 2015 17:13:18 +0000 (19:13 +0200)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Thu, 13 Aug 2015 12:46:39 +0000 (14:46 +0200)
Fix a possibly faulty condition based on a comparison of boolean
with integer (TRUE >= 2) which always results in TRUE.
To avoid this, an additional integer test for the first
part of the condition statement has been added.

Resolves: #68494
Releases: master, 6.2
Change-Id: Icf7b55532483e6a315b93c001ddf41f1caf3a7f8
Reviewed-on: http://review.typo3.org/42064
Reviewed-by: Tomas Norre Mikkelsen <tomasnorre@gmail.com>
Reviewed-by: Mathias Brodala <mbrodala@pagemachine.de>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
typo3/sysext/extbase/Classes/Persistence/Generic/Storage/Typo3DbBackend.php [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 0858476..40e9c74
@@ -765,7 +765,7 @@ class Typo3DbBackend implements BackendInterface, \TYPO3\CMS\Core\SingletonInter
                // order would be destroyed and possible limits not met anymore)
                if (!empty($pageRepository->versioningWorkspaceId)
                        && !empty($GLOBALS['TCA'][$tableName]['ctrl']['versioningWS'])
-                       && $GLOBALS['TCA'][$tableName]['ctrl']['versioningWS'] >= 2
+                       && (int)$GLOBALS['TCA'][$tableName]['ctrl']['versioningWS'] >= 2
                        && count($rows) === 1
                ) {
                        $movePlaceholder = $this->databaseHandle->exec_SELECTgetSingleRow(