craftcms / craftcms/cms

[5.x]: Duplicating content in the matrix field

Open
#18,280 7 comments 1 reaction 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

After changing the propagation method param for a matrix field and then deploying it to a server in one of our projects, we got duplicate blocks of this matrix on each of the subsites.

The client removed duplicates for the current version of the subsites, but if you try to apply any old revision, the duplicates appear again.

Normal state:
Image

Content in the revision:
Image

Entry after trying to apply broken revision
Image

Steps to reproduce
  1. Creating a matrix field with the propagation method parameter value set to all
  2. Fill some content on multiple subsites
  3. Change the propagation method to none
  4. Apply project changes on the another environment
Expected behavior

Revisions should not contain duplicate content.
When applying an old revision from any site, duplicate content should NOT appear in the entry.

Actual behavior

The revisions contained duplicate content.
Applying an old revision from any site resulted in duplicate content appearing in the entry.

Craft CMS version

5.8.22

PHP version

8.3.27

Operating system and version

Linux 6.6.87.2

Database type and version

MySQL 8.0.40

Image driver and version

GD 8.3.27

Installed plugins and versions

Autologin 4.0.1
Azure Blob Storage 2.1.0
Blitz 5.12.6
Blocksmith 1.7.0
CKEditor 4.10.1
Cloudflare Image Transforms 2.2.0
Cloudflare Turnstile 2.0.1
CP Field Inspect 2.0.4
Craft Commerce 5.4.8
Dumper 5.0.1
Expanded Singles 3.0.3
Formulieren 5.12.4
Mailgun 3.1.0
Mollie for Craft Commerce 4.4.0
Navigation 3.0.13
Retour 5.0.12
Sentry Logger 5.0.2
SEOmatic 5.1.19
Sprig 3.7.1
Super Table 4.0.5
Typed link field 5.0.0
Vite 5.0.1

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 listed propagation and deployment steps on Craft CMS 5.8.22 with MySQL, then trace revision application for the matrix field across subsites. Done means revisions contain no duplicate content and applying an old revision does not recreate duplicate blocks.

Written by the indexing model from the issue text.

Assessment

Tech stack
mysql, php
Domain
backend, database
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.