Project

General

Profile

Actions

Bug #95294

open

cruser_id and crdate modified when versioning

Added by Francois Suter over 2 years ago. Updated over 2 years ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Workspaces
Target version:
-
Start date:
2021-09-21
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
11
PHP Version:
8.0
Tags:
Complexity:
Is Regression:
Sprint Focus:

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.

Actions #1

Updated by Francois Suter over 2 years ago

The path into the code is the following:
  • the \TYPO3\CMS\Workspaces\Hook\DataHandlerHook::processCmdmap() hook triggers the creation of a new version by invoking \TYPO3\CMS\Core\DataHandling\DataHandler::versionizeRecord()
  • in turn this calls \TYPO3\CMS\Core\DataHandling\DataHandler::copyRecord_raw()
  • which itself calls \TYPO3\CMS\Core\DataHandling\DataHandler::insertNewCopyVersion() which is where "crdate", "cruser_id" and "tstamp" are forcefully set

So 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.

Actions #2

Updated by Francois Suter over 2 years ago

As a workaround for now, I have used the processCmdmap_afterFinish to 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().

Actions

Also available in: Atom PDF