Bug #99985
closedDataHandler: transOrigDiffSourceField not written on translation initialization
100%
Description
When creating a translation, DataHandler copies the record and adds some defaults from original source.
During copying, method fillInFieldArray writes correct data to
$originalLanguage_diffStorage.
Unfortunately, the original content from transOrigDiffSourceField is copied to the $fieldArray. This is useful for history/undo, as described later, but with this behaviour it's not possible to detect changes from source in translation, when translation record is only created and not saved again. A save after creation will fill in diffsource correctly.
To allow adding the diffsource to newly created records without changing the other behaviour, it should managed, that the if-construct checking the write allowed, should check for
strpos((string)$id, 'NEW') !== false
too.
I tested with following setups, all the same behaviour:
- php 7.4
- nginx
Affected TYPO3 versions:
- 9 ELTS
- 10 old LTS
- 11 LTS
untested, but should be affected, too:
- v12
I guess, this part should be changed
// Add diff-storage information:
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);
}
to this
// Add diff-storage information:
if (
$diffStorageFlag
&& (
!array_key_exists($GLOBALS['TCA'][$table]['ctrl']['transOrigDiffSourceField'], $fieldArray)
|| strpos((string)$id, 'NEW') !== false
)
) {
// 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);
}
Updated by Gerrit Code Review almost 2 years ago
- Status changed from New to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/77895
Updated by Gerrit Code Review almost 2 years ago
Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/77895
Updated by Gerrit Code Review almost 2 years ago
Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/77895
Updated by Gerrit Code Review almost 2 years ago
Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/77895
Updated by Gerrit Code Review over 1 year ago
Patch set 5 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/77895
Updated by Gerrit Code Review over 1 year ago
Patch set 6 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/77895
Updated by Gerrit Code Review over 1 year ago
Patch set 7 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/77895
Updated by Gerrit Code Review over 1 year ago
Patch set 8 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/77895
Updated by Gerrit Code Review over 1 year ago
Patch set 9 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/77895
Updated by Gerrit Code Review over 1 year ago
Patch set 10 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/77895
Updated by Gerrit Code Review over 1 year ago
Patch set 1 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/77945
Updated by Markus Hofmann over 1 year ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 5df55e11912937dd4c413b4e1197dae27ea64d72.