Once previewed in XB an entity with no changes will still show up in "Review x changes"

Created on 28 January 2025, 4 days ago

Overview

Follow-up to [PP-1] Create api slice for auto-save data (pending changes) and publishing all data Postponed
Chatting with @jessebaker he pointed out that if you open up a node in XB it you will immediately have it in "Review changes"
This is because in ApiPreviewController well always auto-save regardless of whether it is the same as the save version.
This could happen if you just open up the entity and preview it in XB or if do an operation, such as adding a new component or reordering components, and then select "undo" or just undo the operation manually, reseting to the saved version

Proposed resolution

Only do auto-saves for entities that are different than there save versions.

In \Drupal\experience_builder\Controller\ApiPublishAllController::__invoke we have logic to convert auto-save data to entities ready for validating/saving. We may want to move this logic into the auto-save manager(or somewhere else) so we can then compare the entities to the saved version. If there no changes to the saved versions we would then not create the auto-save entry and if there already is one delete it.

User interface changes

🐛 Bug report
Status

Active

Version

0.0

Component

Page builder

Created by

🇺🇸United States tedbow Ithaca, NY, USA

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

Comments & Activities

Production build 0.71.5 2024