Commit a7e2c7e7 authored by Thomas Hohn's avatar Thomas Hohn Committed by Andreas Fernandez
Browse files

[CLEANUP] Simplify updating of timestamp in writeForeignField

There is no need to check the record we are updating -
since we update it anyway, update timestamp too and
save both a call to getRecord and a loop through fields,
casting and checking each field value comparing to DB.

Change-Id: Ic807030c5cea83d36e543ed0f75cf980c3872d1e
Releases: master, 7.6
Resolves: #79004

Tested-by: default avatarTYPO3com <>
Reviewed-by: Philipp Gampe's avatarPhilipp Gampe <>
Tested-by: Philipp Gampe's avatarPhilipp Gampe <>
Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <>
Tested-by: Andreas Fernandez's avatarAndreas Fernandez <>
parent 77cd9436
......@@ -1150,21 +1150,7 @@ class RelationHandler
if (!empty($updateValues)) {
// Update tstamp if any foreign field value has changed
if (!empty($GLOBALS['TCA'][$table]['ctrl']['tstamp'])) {
$currentRow = BackendUtility::getRecord($table, $uid, implode(',', array_keys($updateValues)), '', true);
$needTstampUpdate = false;
if (empty($currentRow)) {
$needTstampUpdate = true;
} else {
foreach ($currentRow as $field => $curValue) {
if ((string)$curValue !== (string)$updateValues[$field]) {
$needTstampUpdate = true;
if ($needTstampUpdate) {
$updateValues[$GLOBALS['TCA'][$table]['ctrl']['tstamp']] = $GLOBALS['EXEC_TIME'];
$updateValues[$GLOBALS['TCA'][$table]['ctrl']['tstamp']] = $GLOBALS['EXEC_TIME'];
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