Project

General

Profile

Actions

Bug #68494

closed

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

Added by Artur Cichosz over 9 years ago. Updated about 6 years ago.

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

100%

Estimated time:
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
) {
[...]
}
Actions

Also available in: Atom PDF