Multisite & drafts issue when saving the same entry in different sites
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 3.6k
- Forks
- 705
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 134
Description
Description
We're running into an issue when multiple people are editing the same single across different sites.
When a save happens on site A, matrix blocks on site B get merged into the automatically created draft.
We're using the same single across all sites and the matrix fields are set to "Save blocks to other sites in the same group".
I've made 2 screen-recordings to illustrate the issue:
- field & section settings: https://drive.google.com/file/d/1yxs8xmTCTb9OoTie2t3nT8mMTkwgu_CF/view?usp=sharing
- reproducing the problem: https://drive.google.com/file/d/1Cb4uQw-1wKcLAxSn3J8L2Q9b_9mkMR8f/view?usp=sharing
This was reported in production when 2 separate people were working on the site and ran into issues (the duplicated block causes an error when saving the entry since the field is set to max 1).
Steps to reproduce
https://drive.google.com/file/d/1Cb4uQw-1wKcLAxSn3J8L2Q9b_9mkMR8f/view?usp=sharing
Additional info
- Craft version: 3.6.17
- PHP version: 7.4.21
- Database driver & version: MySQL 5.7.34
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Begin with the linked reproduction recording and the reported Craft 3.6.17 setup, using the multisite single and Matrix setting described in the issue. Confirm that saving on one site merges or duplicates blocks in another site's draft; done means separate-site saves no longer create the duplicated block or the resulting max-one validation error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mysql, php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100