Repository navigation
Locking or unlocking content in the new Edit Content reverts unsaved Relationship field changes #38034
Description
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):
lockContentandunlockContentincore-web/libs/edit-content/src/lib/store/features/lock/lock.feature.tsreplacecontentletin the store with a new object, even though onlylocked,lockedBy,lockedByNameandlockedOnchange.DotRelationshipFieldComponent(fields/dot-edit-content-relationship-field/components/dot-relationship-field/dot-relationship-field.component.ts) builds$inputsfrom$contentlet()and callsinitialize(this.$inputs)as a reactivesignalMethod. Any newcontentletreference therefore re-initializes the relationship store from the saved data, overwriting the user's pending changes.
Browser: Chrome, macOS.
Steps to Reproduce
- 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.
- Click Lock for Editing in the sidebar.
- In the Author field, remove "Will" (or add a new related item).
- Click Unlock.
- Actual: "Will" is back in the Author field and the change from step 3 is lost.
- 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
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsCurrent Sprint Backlog
Activity
erickgonzalez commentedon Oct 15, 2026
Please check also the following fields: