Allow to migrate field for all content revisions

Created on 20 May 2023, over 1 year ago
Updated 17 June 2023, over 1 year ago

Problem/Motivation

At the moment we migrating files only from the fields of the actual revision of the entities (the last published revision).
But for some clients are very important to use actions like reverting the revision and after such a migration content reverting will lose an image. Without migration of revisions, the values of media fields will be lost after reverting, which should not be the case if the revision contained a file.

Also, if we don't pay attention to revisions, we may lose files that exist only within the scope of the revisions.

Steps to reproduce

- Enable content moderate module.
- Configure the module for some content type.
- Add an image field to the content or use an existing one.
- Create content with Image A
- Create a new revisions with Image B
- Migrate the image field into the media with our module.
- Make sure that content contains the expected media image - Image B
- Revert the content revisions to the first one.
Expected behavior: media image is Image A
Current behavior: media image is empty

Proposed resolution

- make a new option for the generator: include_revisions
- update the source plugins for steps 1 and 2 to include files from all revisions.
- make a new destination plugin to update the target revision of the entity

Remaining tasks

In the ticket ✨ Optimize the source plugin for step 2 Fixed we already implemented one source plugin with include_revisions option

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine HitchShock Ukraine

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024