-
Notifications
You must be signed in to change notification settings - Fork 682
Open
Labels
Description
What happened?
Description
In a multi-site environment with concurrent users, provisional drafts created by one user can implicitly merge and later reapply site-specific content changes made by another user. This can result in deleted components being unintentionally restored when a provisional draft is saved, even though those components were already removed and saved by a different user.
Environment
- Craft CMS multi-site setup
- Two concurrent users with different permission scopes:
- User A: Admin-level user with access to all sites
- User B: Site-restricted user with access to a single site
Steps to reproduce
- User A opens an entry that exists across multiple sites and makes a change in the entry editor without saving (creating a provisional draft).
- User B switches to their assigned site and:
- Adds a new component/block to the entry.
- Leaves the component empty / invalid.
- Does not save yet.
- User B navigates away from the entry editor and triggers a save action in another context (e.g. another site of the same entry).
- The empty / invalid component is now saved for User B’s site, even though it was not explicitly saved in the entry editor.
- User A reloads the entry editor and observes that the empty component has been merged into the provisional draft for User B’s site (without saving).
- User B:
- Fills in the previously empty component.
- Saves the entry.
- User A reloads the editor again and sees that the newly added content is now also reflected in the provisional draft for User B’s site (still without saving).
- User B deletes the component and saves the entry.
- User A reloads the editor and observes that the deleted component is still present in the provisional draft for User B’s site.
- User A saves the entry, applying the provisional draft.
Expected behavior
Saving an entry that has invalid content on any site the user has access to cannot be saved.
Actual behavior
Saving of invalid (e.g. empty content on mandatory fields) is possible potentially leading to content loss or invalid content.
Craft CMS version
5.8.21
PHP version
8.3
Operating system and version
No response
Database type and version
MariaDB 10.6
Image driver and version
No response