Skip to content

Locking or unlocking content in the new Edit Content reverts unsaved Relationship field changes #38034

Open

Description

@adrianjm-dotCMS

Problem Statement

In the new Edit Content, locking or unlocking the content from the sidebar (Lock for Editing / Unlock) throws away the unsaved changes in every Relationship field. A user can edit the content without locking it first. If they add or remove related items and then click Lock or Unlock, the field goes back to the saved relationships, with no warning. Other fields keep their unsaved edits; we checked the Title.

Any editor who touches a relationship and then changes the lock state loses that work silently, and may save the content believing the relationship change is still there.

Screen.Recording.2026-10-14.at.2.23.58.PM.mov

Cause (from the code):

  1. lockContent and unlockContent in core-web/libs/edit-content/src/lib/store/features/lock/lock.feature.ts replace contentlet in the store with a new object, even though only locked, lockedBy, lockedByName and lockedOn change.
  2. DotRelationshipFieldComponent (fields/dot-edit-content-relationship-field/components/dot-relationship-field/dot-relationship-field.component.ts) builds $inputs from $contentlet() and calls initialize(this.$inputs) as a reactive signalMethod. Any new contentlet reference therefore re-initializes the relationship store from the saved data, overwriting the user's pending changes.

Browser: Chrome, macOS.

Steps to Reproduce

  1. Open a Blog content (e.g. "Easy Snowboard Tricks You can Start Using Right Away" from the demo starter) in the new Edit Content. It has one related item, "Will", in the Author relationship field.
  2. Click Lock for Editing in the sidebar.
  3. In the Author field, remove "Will" (or add a new related item).
  4. Click Unlock.
  5. Actual: "Will" is back in the Author field and the change from step 3 is lost.
  6. Expected: the Author field still shows the change made in step 3.

The reverse order fails too: with the content unlocked, change the Title and remove "Will", then click Lock for Editing. The Title keeps its new value, but "Will" comes back.

Acceptance Criteria

  • Unsaved changes in a Relationship field (items added, removed or reordered) are kept after Lock for Editing.
  • Unsaved changes in a Relationship field are kept after Unlock.
  • Unsaved changes in a Relationship field are kept after Release Lock (content locked by another user, confirmed in the dialog).
  • If the lock or unlock request fails, the field keeps the user's unsaved changes.
  • The lock state, the Lock / Unlock button and the workflow actions still update as today after lock and unlock.
  • The relationship field still re-initializes when it should: when another contentlet or version is loaded, and for manual translation / populate locale.
  • Unit tests cover lock and unlock with pending relationship changes and fail without the fix.

dotCMS Version

Latest from main (1.0.0-SNAPSHOT, build of Oct 9, 2026), local instance.

Severity

Medium - Some functionality impacted

Links

NA

Activity

  1. moved this from New to Current Sprint Backlog in dotCMS - Product Planningon Oct 14, 2026
  2. erickgonzalez commented on Oct 15, 2026

    @erickgonzalez
    Member

    Please check also the following fields:

    • Categories
    • Tags
    • Key/Value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions