Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mmikkel opened this issue May 2, 2024 · 6 comments
Closed
Labels

Comments

@mmikkel
Copy link
Contributor

mmikkel commented May 2, 2024

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

@brandonkelly
Copy link
Member

Thanks for reporting that! Just released Craft 5.1.1 with a fix.

@useralberto
Copy link

Hello @brandonkelly !

We're still experiencing the same issue: when assigning a limit to a matrix, we receive the following message. This is using Craft CMS version 5.1.2.

bug.mp4

@brandonkelly
Copy link
Member

Hey @useralberto, your Matrix field’s propagation method is set to “Save entries to all sites the owner element is saved in”, so this is a different issue. I’m not sure what it could be, though. Any chance you can send a database backup and Composer files into support@craftcms.com?

@brandonkelly
Copy link
Member

@useralberto Actually, this could be related to #14973. Going to release the fix for that tomorrow. If you want to test in the meantime, change your craftcms/cms requirement in composer.json to 5.x-dev as 5.1.2 and run composer update.

@useralberto
Copy link

I understand, I'll review the details of #14973 and run some tests, and today we also came across this error, I think it goes hand in hand with the previous one...

Thanks @brandonkelly

Captura de pantalla 2024-05-14 a la(s) 11 41 57 a m

@brandonkelly
Copy link
Member

@useralberto Hm not sure. Try resaving the global set from a site you’re able to access it from, and then see if the error persists. If so, please send your Composer files and a database backup to support@craftcms.com so we can look into it further, if possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants