Section Disappears When Saving in Mercury Editor Under Certain Conditions

Created on 29 November 2024, 4 months ago

Problem/Motivation

When using the Mercury Editor in a Drupal project, entire sections intermittently disappear after saving. This issue has been observed in various scenarios, such as setting an administrative title, changing styles in Style tab or just adding a new component. The inconsistency of the problem makes it challenging to reproduce reliably, but it disrupts content management workflows and risks data loss.
A video demonstration of the issue is available here.

Steps to reproduce

  • Open a page or section that utilizes the Mercury Editor.
  • Make a change, such as setting an administrative title.
  • Save the changes.
  • Observe that the entire section disappears after the page reloads.
  • Note that this behavior occurs inconsistently but has been reported in various scenarios.

Proposed resolution

  • Investigate how the Mercury Editor handles save operations, particularly the data serialization and deserialization process.
  • Check if specific settings (e.g., administrative title) trigger unexpected behaviors.
  • Debug to identify potential conflicts in the JavaScript responsible for saving and rendering content.
  • Ensure proper validation and fallback mechanisms to prevent section removal.
πŸ› Bug report
Status

Active

Version

2.1

Component

User interface

Created by

πŸ‡§πŸ‡¦Bosnia and Herzegovina drale01 Sarajevo

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

Comments & Activities

  • Issue created by @drale01
  • πŸ‡§πŸ‡¦Bosnia and Herzegovina drale01 Sarajevo

    When I removed all Twig files from my custom theme and cleared the cache, I was able to make changes using the Mercury Editor and save them without experiencing any content disappearing issues. After saving, I restored all the Twig files.

  • πŸ‡§πŸ‡¦Bosnia and Herzegovina drale01 Sarajevo
  • πŸ‡ΊπŸ‡ΈUnited States sbubaron

    I had similar issues when we first implemented, I believe the problem came down to bad html in my custom twig file, missing a closing tag on a div.

  • πŸ‡ΊπŸ‡ΈUnited States sethhill

    We made a change in πŸ› Pages update incorrectly during saves when page caching enabled Active that addresses issues related to caching and previews. The behavior that we were seeing was that the editor was no longer attached to the correct revision of a paragraph, so when saving it appeared that changes were not saved. We cut a new 2.2-RC1 release with this change.

  • πŸ‡§πŸ‡¦Bosnia and Herzegovina drale01 Sarajevo

    @sbubaron Comment#4

    Yes this fixed my issue. Just one div wasn’t closed. When I fixed there was no more disappearing content.

    Thanks!

Production build 0.71.5 2024