Review main Merged

95651[BUGFIX] Move records back when rolling back the record history

Benni Mack CR +2 V +2 Hard +259 −7 updated 09/07/26, 19:03

Commit message

A rollback silently ignored every move. getDiff() built its result
from the fields of modification entries and from the counted adds
and deletes, and a move entry matched neither, so it was skipped.
Moving a record and rolling back afterwards produced an empty diff:
the module claimed there was nothing to roll back and left the
record where it had been moved to.

A move is now carried through getDiff() as "moves", holding the
position the record had before the oldest move of the changelog,
and is turned into a move command of the rollback. Neither pid nor
sorting is a TCA column, so this cannot go through the data map
that restores fields.

A stored sorting value has no meaning on its own, it only says
something next to the records that are on the page now. The
predecessor is therefore looked up while rolling back, and the
record is moved after it, which is what DataHandler expects as a
negative destination. A record that was the first one on its page
is moved to the top of that page again.

The rollback preview announces the move, so nothing happens that
was not shown before, and a record that is deleted by the same
rollback is not moved anywhere.

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
    • Wouter Wolters +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Wouter Wolters +1
    • core-ci +1 CI

Issues 1

Files 8

Review log 56

  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, 15:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/107895

  3. Stefan Bürk voted on patch set 1 CR +1 09/07/26, 13:02

  4. Wouter Wolters voted on patch set 1 CR +1 V +1 09/07/26, 17:02

  5. Stefan Bürk voted on patch set 1 CR +2 V +2 09/07/26, 17:08

  6. Stefan Bürk merged patch set 2 09/07/26, 19:03