craftcms / craftcms/cms

Multisite & drafts issue when saving the same entry in different sites

Open
#9,962 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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:

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.