Project

General

Profile

Actions

Bug #104396

open

DataHandler::inlineLocalizeSynchronize fails for tables without versioning

Added by Hannes Lau about 7 hours ago. Updated about 7 hours ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
DataHandler aka TCEmain
Target version:
-
Start date:
2024-07-15
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
12
PHP Version:
8.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

In https://github.com/TYPO3/typo3/blob/12.4/typo3/sysext/core/Classes/DataHandling/DataHandler.php#L5031 the andWhere Clause `'AND t3ver_oid=0'` is always appended, even for tables without versioning. This leads to an invalid field exception `unknown column t3ver_oid`.

Original:

$parentRecordLocalization = BackendUtility::getRecordLocalization($table, $id, $command['language'], 'AND t3ver_oid=0');

Quick patch was:

-            $parentRecordLocalization = BackendUtility::getRecordLocalization($table, $id, $command['language'], 'AND t3ver_oid=0');
+            $useVersioning = (bool) ($GLOBALS['TCA'][$table]['ctrl']['versioningWS'] ?? false);
+            $versioningWhereClause = $useVersioning ? 'AND t3ver_oid=0' : '';
+            $parentRecordLocalization = BackendUtility::getRecordLocalization($table, $id, $command['language'], $versioningWhereClause);

Actions #1

Updated by Hannes Lau about 7 hours ago

  • Description updated (diff)
Actions

Also available in: Atom PDF