Skip to content

[5.x]: Changed propagation method for a matrix field does not affect existing entries #16740

@MoritzLost

Description

@MoritzLost

What happened?

Description

I have a matrix field in a multi-site that was previously set to the propagation method Save entries to all sites the owner element is saved in. Then the client wanted to have different contents depending on the site, so we changed that to Only save entries to the site they were created in. Now this is working for newly created content, we can add and delete entries in the matrix field that will only be saved for the current site.

However, we have a problem with all existing content in that field. The previously created entries in the matrix field seem to still be connected across sites, they still share the same ID. Deleting one of those in one site deletes it from all sites. So any time an author wants to delete an entry in one site, they have to recreate it in all other sites.

Steps to reproduce

  1. Create a matrix field with the propagation method set to Only save entries to the site they were created in.
  2. In a multisite, create a section and entry type and add the matrix field to that entry type. Create an entry in that section that's propagated to all sites and add some nested entries in the matrix field.
  3. Change the propagation method of the matrix field to Only save entries to the site they were created in and wait for the resutling queue jobs to finish.
  4. Delete a nested entry in the matrix field in one site and check the field contents in another site.

Expected behavior

Changing the propagation method should result in consistent behaviour for both existing and new entries. When changing the propagation method, the following warning pops up:

Applying this change to existing entries can take some time.

After changing the setting, there's also a queue job that seems to apply the new propagation method to all existing contents. Does that mean the behaviour I'm seeing is a bug?

Actual behavior

Existing contents behave inconsistent with new contents after changing the propagation method.

EDIT: The issue only happened in production. In my development environment, all entries in the matrix field in all existing content are separate and have different IDs. So it looks like this is an issue with the ApplyNewPropagationMethod queue job not being enqueued during a deployment? There are no pending or failed queue jobs in the production environment.

Craft CMS version

5.6.6

PHP version

8.3

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions