#95294cruser_id and crdate modified when versioning
Description
When a change is made in a workspace, a copy of the record is made (the new version until it is published). On that copy the cruser_id field is set to the user who triggered this new version. The crdate field is also changed to the time when the version was created. When the version is published, these become the new values for the live record.
We thus lose the historical creation information about this record. It may be of limited value, but I still think that it is wrong to overwrite it.
Reviews 2
History 47
-
Francois Suter commented <span data-processor="relativetime" data-value="2021-09-22T12:13:45+00:00" > 09/22/21, 12:13 </span>
-
Francois Suter commented <span data-processor="relativetime" data-value="2021-09-22T15:54:38+00:00" > 09/22/21, 15:54 </span>
As a workaround for now, I have used the
processCmdmap_afterFinishto restore the creation user and date information in case of a versioning operation. Not very clean, but functional.I guess that rather than trying to modify
\TYPO3\CMS\Core\DataHandling\DataHandler::insertNewCopyVersion()it might be easier to add some postprocessing to\TYPO3\CMS\Workspaces\Hook\DataHandlerHook::processCmdmap(). -
Gerrit Code Review pushed patch set 1 for main to change 88990 status
NewUnder Review <span data-processor="relativetime" data-value="2025-04-08T19:20:50+00:00" > 04/08/25, 19:20 </span> -
Gerrit Code Review pushed patch set 2 for main to change 88990 <span data-processor="relativetime" data-value="2025-04-08T19:22:59+00:00" > 04/08/25, 19:22 </span>
-
Gerrit Code Review pushed patch set 1 for 13.4 to change 88993 <span data-processor="relativetime" data-value="2025-04-09T08:16:00+00:00" > 04/09/25, 08:16 </span>
-
Benni Mack commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2025-04-09T08:25:09+00:00" > 04/09/25, 08:25 </span>Applied in changeset commit:9b1c715d1a383c974e1dfe4d70a55385d2ef47b8.
-
Benni Mack changed status
ResolvedClosed <span data-processor="relativetime" data-value="2025-12-02T14:33:53+00:00" > 12/02/25, 14:33 </span>
\TYPO3\CMS\Workspaces\Hook\DataHandlerHook::processCmdmap()hook triggers the creation of a new version by invoking\TYPO3\CMS\Core\DataHandling\DataHandler::versionizeRecord()\TYPO3\CMS\Core\DataHandling\DataHandler::copyRecord_raw()\TYPO3\CMS\Core\DataHandling\DataHandler::insertNewCopyVersion()which is where “crdate”, “cruser_id” and “tstamp” are forcefully setSo the solution is not an easy one, because it means interfering deep down in the DataHandler class, at a point where there’s no entry point (hook, event) yet.