Bug #68494

Workspaces, move-placeholder for table "pages_language_overlay" processed although it's not supported

Added by Artur Cichosz over 4 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Workspaces
Target version:
-
Start date:
2015-07-23
Due date:
% Done:

100%

TYPO3 Version:
6.2
PHP Version:
5.5
Tags:
Complexity:
easy
Is Regression:
No
Sprint Focus:

Description

Debugging SQL errors in frontend (Unknown column 't3ver_move_id' in 'where clause') I discovered that the reason is inside the class TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend.

In line 782++, there is the following consition

if (!empty($pageRepository->versioningWorkspaceId)
&& !empty($GLOBALS['TCA'][$tableName]['ctrl']['versioningWS'])
&& $GLOBALS['TCA'][$tableName]['ctrl']['versioningWS'] >= 2
&& count($rows) === 1
) {
[...]
}

The problem is, that this condition is TRUE for the table "pages_language_overlay" while it probably shouldn't (there is no field t3ver_move_id in TCA).
This condition is TRUE because of the test $GLOBALS['TCA'][$tableName]['ctrl']['versioningWS'] >= 2.

For table "pages_language_overlay" the value $GLOBALS['TCA'][$tableName]['ctrl']['versioningWS'] is a boolean and TRUE, so the check is TRUE >= 2 which is TRUE.

I suppose the code should get corrected to the following version:

if (!empty($pageRepository->versioningWorkspaceId)
&& !empty($GLOBALS['TCA'][$tableName]['ctrl']['versioningWS'])
&& (is_int($GLOBALS['TCA'][$tableName]['ctrl']['versioningWS']) && $GLOBALS['TCA'][$tableName]['ctrl']['versioningWS'] >= 2)
&& count($rows) === 1
) {
[...]
}

Associated revisions

Revision 9c431cd6 (diff)
Added by Artur Cichosz over 4 years ago

[BUGFIX] Fix faulty move-placeholder processing with workspaces

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 <>
Reviewed-by: Mathias Brodala <>
Reviewed-by: Stefan Neufeind <>
Tested-by: Stefan Neufeind <>

Revision fd872541 (diff)
Added by Artur Cichosz over 4 years ago

[BUGFIX] Fix faulty move-placeholder processing with workspaces

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/42573
Reviewed-by: Stefan Neufeind <>
Tested-by: Stefan Neufeind <>

History

#1 Updated by Susanne Moog over 4 years ago

Hey,

thanks for finding this bug. Would you mind creating a patch? You can find a howto here: https://wiki.typo3.org/Contribution_Walkthrough_Tutorials

Cheers,

Susi

#2 Updated by Gerrit Code Review over 4 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42064

#3 Updated by Artur Cichosz over 4 years ago

Hi,
I made a change request for the master branch http://review.typo3.org/42064 to be backported to 6.2.

#4 Updated by Gerrit Code Review over 4 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42064

#5 Updated by Gerrit Code Review over 4 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42064

#6 Updated by Gerrit Code Review over 4 years ago

Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42573

#7 Updated by Anonymous over 4 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#8 Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF