Commit b883baac authored by Christian Kuhn's avatar Christian Kuhn Committed by Andreas Fernandez
Browse files

[BUGFIX] l10n_diffsource field can handle empty string and null value

Depending on DB platform, empty LOB fields can be returned
as NULL value (sqlite) or as empty string (mysql, our postgres
setup, mssql).

The patch adapts a minor detail in DataHandler since isset(null)
is false, but isset('') is true, it uses an array_key_exists()
instead for diff check on transOrigDiffSourceField / l10n_diffsource
field to align these two possible different db return values.

Resolves: #85186
Releases: master
Change-Id: I56c87fa519a0c787515eff403d48ac84e513300d

Reviewed-by: Daniel Siepmann's avatarDaniel Siepmann <>
Tested-by: default avatarTYPO3com <>
Tested-by: Daniel Siepmann's avatarDaniel Siepmann <>
Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <>
Tested-by: Andreas Fernandez's avatarAndreas Fernandez <>
parent 06551021
......@@ -1464,7 +1464,8 @@ class DataHandler implements LoggerAwareInterface
&& $GLOBALS['TCA'][$table]['ctrl']['languageField']
&& $currentRecord[$GLOBALS['TCA'][$table]['ctrl']['languageField']] > 0
&& $GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField']
&& (int)$currentRecord[$GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField']] > 0) {
&& (int)$currentRecord[$GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField']] > 0
) {
$originalLanguageRecord = $this->recordInfo($table, $currentRecord[$GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField']], '*');
BackendUtility::workspaceOL($table, $originalLanguageRecord);
$originalLanguage_diffStorage = unserialize($currentRecord[$GLOBALS['TCA'][$table]['ctrl']['transOrigDiffSourceField']]);
......@@ -1568,7 +1569,9 @@ class DataHandler implements LoggerAwareInterface
// Add diff-storage information:
if ($diffStorageFlag && !isset($fieldArray[$GLOBALS['TCA'][$table]['ctrl']['transOrigDiffSourceField']])) {
if ($diffStorageFlag
&& !array_key_exists($GLOBALS['TCA'][$table]['ctrl']['transOrigDiffSourceField'], $fieldArray)
) {
// If the field is set it would probably be because of an undo-operation - in which case we should not update the field of course...
$fieldArray[$GLOBALS['TCA'][$table]['ctrl']['transOrigDiffSourceField']] = serialize($originalLanguage_diffStorage);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment