craftcms / craftcms/cms

[3.x]: After adding a switch on dev and applying the yaml files site is ruined: all matrix blocks are now doubled

Open
#11,609 32 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug craft3
Dominant language
PHP
Stars
3.6k
Forks
705
Avg merge
1d 5h
Merged PRs (30d)
134

Description

What happened?
Description

After adding a switch field to one of the matrix blocks of a matrix field that's used for content on each page and applying the yaml files to the staging server the full site is ruined by some 'propagating' action Craft does; all matrix blocks on each page on each site are doubled.

I don't even know how such a thing might be explained, but it's obviously pretty frustrating.

For some reason restoring the database doesn't even work (even when removing all cache and do a garbage collect). And now I don't even know how to restore this and if that's even possible without needing to change all 440 pages by hand :(
Which were all containing new data. I have regularly created backups of these, but the backup restore doesn't fix this issue, or fixes it to let Craft destroy it again by this 'propagation...' action?

Steps to reproduce
  1. Add a switch to one of the matrix blocks in a matrix field on local DEV environment
  2. Deploy the code to the staging server, which updates the yaml files
  3. Craft does some magic making all matrix blocks now doubled on each page, on each site (also the many pages which aren't even using this block)
Expected behavior

No change on the existing entries, only adding the new switch to where this block is used and set it to the default value.

Actual behavior

See above

Craft CMS version

3.7.48

PHP version

8.x

Operating system and version

Apache

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

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 by reproducing the YAML deployment steps on Craft CMS 3.7.48 with a Matrix field containing a newly added switch, then investigate the propagation action affecting existing blocks across sites. Done means applying the updated YAML preserves existing entries without duplicating Matrix blocks; the payload names no source files or tests to run.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend, content
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.