Skip to content

[5.x]: Matrix field's "Max Entries" setting doesn't respect propagation setting #14932

@mmikkel

Description

@mmikkel

What happened?

Description

In a multi-site install, if a non-propagating Matrix field is configured with a "Max Entries" limit, it's no longer possible to create new nested entries for the field in propagated owner entries in other sites, once the maximum number of nested entries have been created in one of the sites.

Specifically, clicking the Matrix field's "New entry" button fails with an error toast User not authorized to create this element.

This appears to occur regardless of the "View Mode" setting (have tested with cards and inline-editable blocks).

Complete error response

CleanShot.2024-05-02.at.22.37.16.mp4

Steps to reproduce

  1. Create two sites
  2. Create a Matrix field. Set the "Max Entries" setting to a number (I had 3). Set the "Propagation Method" to Only save entries to the site they were created in. Leave all other settings at their defaults.
  3. Create a section that propagates entries to both sites. Add an entry type with the Matrix field to that section.
  4. Create an entry in the section, and then create the maximum allowed number of nested entries in the Matrix field. Save the entry.
  5. Switch the entry to the other site. The Matrix field should appear empty, as its nested entries are not propagated. Click the Matrix field's "New Entry" button.

Expected behavior

The "Max Entries" setting should not apply across sites, in cases where the nested entries aren't being propagated.

Actual behavior

The "Max Entries" seems to apply irrespective of the Matrix field's propagation method.

Once the max limit is reached in one site, it's no longer possible to create new nested entries in other sites.

Removing the "Max Entries" setting fixes the issue.

Craft CMS version

5.1.0

PHP version

No response

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

None

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