Content being edited XB will error on publishing if saved outside of XB

Created on 25 July 2025, 8 days ago

Overview

Follow-up to πŸ› Add rudimentary conflict prevention to the Config Auto-save end-point Active

Steps to reproduce

  1. Create an article
  2. Open in XB
  3. change the title to "XB title" - leave the tab open
  4. edit the node outside of XB at node/1/edit
  5. change the title to "Drupal title"
  6. save the node
  7. go back to the article in XB
  8. try to publish it
  9. should get the error:
    The content has either been modified by another user, or you have already submitted modifications. As a result, your changes cannot be saved.
  10. Refresh the browser - do not make any changes
  11. Try to publish again
  12. should get the same error
  13. Make a change to the title in XB
  14. Try to publish again
  15. It should work this time

Why it works after making change is that then the auto-save is re-created from the current input which goes through form submission process again.

If immediately after node is updated outside XB, the user instead tries to make an edit in the XB version then the user will get the error that ends with

Please refresh your browser to receive the latest changes and continue.

This is because the browsers xb auto-save has a autoSaveStartingPoint that is made with the prevision revision. See \Drupal\experience_builder\Controller\AutoSaveValidateTrait::getClientAutoSaveData

If then refreshed their browser they will be able publish. since this is same experience as if another user was editing the same node inside XB there would be no way for a user to tell the difference. When the user published they would erase any changes made outside XB, if they access to the fields changed

Proposed resolution

Before deciding on the technical solution we should decide that desired user experience is for when a content entity is edited outside of XB when there is current auto-saved version of the same

Possible solutions

  1. The user should not get an error, and they should be able to publish. Overriding any changes saved outside of XB
  2. The user should get a message that the entity was saved outside of XB and everything except the XB canvas has been reset to the saved version
  3. The user should get a message and all data including the XB canvas should reset to the saved version
  4. The user should get a UI where they select which fields they want to retain from the auto-saved version, or which fields they want to update from the saved version

User interface changes

πŸ› Bug report
Status

Active

Version

1.0

Component

Auto-save

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

  • Issue created by @tedbow
  • πŸ‡ΊπŸ‡ΈUnited States tedbow Ithaca, NY, USA

    I chatted with @wimleers about this before making the issue we agreed that probably

    The user should get a message that the entity was saved outside of XB and everything except the XB canvas has been reset to the saved version

    Is the best solution for the time being

  • πŸ‡ΊπŸ‡ΈUnited States tedbow Ithaca, NY, USA
  • πŸ‡ͺπŸ‡ΈSpain penyaskito Seville πŸ’ƒ, Spain πŸ‡ͺπŸ‡Έ, UTC+2 πŸ‡ͺπŸ‡Ί

    We should verify this works after reverting a revision too.

Production build 0.71.5 2024