#68494Workspaces, move-placeholder for table "pages_language_overlay" processed although it's not supported
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
) {
[...]
}