craftcms / craftcms/cms

[5.x]: When the Content Block field contains a Matrix field, creating a draft results in an error: Attempting to duplicate an element in an unsupported site

Open
#18,281 4 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

What happened?
Description

When the Content Block field contains a Matrix field, creating a draft results in an error:
The draft could not be saved.
Attempting to duplicate an element in an unsupported site.

Steps to reproduce

The record screen: https://www.awesomescreenshot.com/video/48581983?key=a149ff40afc09785bf1a5af480e71c84

  1. When the Content Block field contains a Matrix field in entry.
  2. Click the Add a site...
  3. Click the Create a draft
Expected behavior

Create a draft

Actual behavior

Get a Error.
Unsupported site – craft\errors\UnsupportedSiteException
Attempting to duplicate an element in an unsupported site.

https://github.com/user-attachments/assets/c776ae2f-9569-4196-bf21-590e50c54b2e

Craft CMS version

Craft Solo 5.8.23

PHP version

8.2.19

Operating system and version

Linux 6.6.87.2-microsoft-standard-WSL2

Database type and version

PostgreSQL 15.15

Image driver and version

Imagick 3.7.0 (ImageMagick 7.1.1-13)

Installed plugins and versions

No plugins are enabled.

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

Start with the record-screen reproduction using a Content Block field containing a Matrix field, then trace the UnsupportedSiteException reported when selecting a site and creating a draft. Done means the draft is created successfully without the unsupported-site error in the reported Craft CMS and PostgreSQL setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, postgresql
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.