Review main Merged

95652[FEATURE] Group and undo record history entries by operation

Benni Mack CR +2 V +2 Hard +512 −18 updated 09/10/26, 06:04

Commit message

One DataHandler run can create, modify, move and delete a number of
records at once, and every history entry it writes shares the scope
of the correlation id of that run. Nothing read that scope, so a
single save showed up as unrelated lines in the history module and
could only be undone one record at a time.

RecordHistory->findEventsForScope() looks up all entries of one
operation. The subject of a correlation id is rewritten per record
by RecordHistoryStore, so only the prefix up to the scope is common
to them, which keeps the lookup a left anchored match. A scope is
base64url encoded and can therefore contain the LIKE wildcard "_",
so the prefix is escaped. One operation can span tables and pages,
and the result is reduced to the records the user may see.

The history module gained a "Group by operation" toggle, off by
default. It shows the entries of one operation next to each other,
introduced by the number of records the whole operation changed,
which is more than the changelog of a single record holds. The
entries are collected per scope instead of marking boundaries in
place: the changelog is sorted by time and all entries of a run
carry the same timestamp, so two operations in the same second
arrive interleaved.

Each group offers to undo the operation as a whole. The entries of
a scope are a changelog like any other, so they run through the
existing getDiff() and rollback, which restores fields, removes
what was created, restores what was deleted and moves records back.
As every rollback it is accepted as POST only, and the
confirmation states that later changes to those records are
overwritten.

The form the rollback buttons submit to moved to the module
template, because the buttons are no longer only in the difference
view. The difference view decides on its own content now instead of
on the presence of that form.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Georg Ringer +1
    • Jochen Roth +1
  • Verified V +2 Done
    • Benni Mack +2
    • Georg Ringer +1
    • Jochen Roth +1
    • core-ci +1 CI

Issues 2

Files 14

Review log 68

  1. Benni Mack uploaded patch set 1 09/04/26, 15:48

  2. core-ci voted on patch set 1 V +1 09/04/26, 16:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/107896

  3. Benni Mack uploaded patch set 2 V +1 09/04/26, 16:37

  4. core-ci voted on patch set 2 V +1 09/04/26, 16:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/107901

  5. Jochen Roth voted on patch set 2 CR +1 V +1 09/08/26, 18:42

  6. Georg Ringer voted on patch set 2 CR +1 V +1 09/09/26, 15:41

  7. Benni Mack voted on patch set 2 CR +2 V +2 09/10/26, 06:04

  8. Benni Mack merged patch set 3 09/10/26, 06:04