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]: 5.3.6 - Adding a second matrix entry even when locked to maximum 1 #15641

Closed
pnpaes opened this issue Sep 2, 2024 · 3 comments
Closed
Labels

Comments

@pnpaes
Copy link

pnpaes commented Sep 2, 2024

What happened?

I create a matrix field with a proper entry type.
I limited that Matrix field to have maximum 1 entry.
I added the matrix field (hero) to my homepage entry.
Entered the homepage and clicked to add a new Hero.
Started to edit but closed the hero editor. Clicked add hero again and a fresh Hero editor opened.
I finlized edititing and saved the hero. it showed up in the home.
but when I refreshed the other one that I started and closed also showed up.

Uploading Screen Recording 2024-09-02 at 2.29.39 PM.mov…

Craft CMS version

5.3.6

PHP version

8.3.3

Operating system and version

Linux 6.6.32-linuxkit

Database type and version

MariaDB 10.7.8

Image driver and version

Imagick 3.7.0 (ImageMagick 6.9.11-60)

Installed plugins and versions

CKEditor 4.2.0
Image Resizer 4.0.1

@pnpaes pnpaes added the bug label Sep 2, 2024
@pnpaes pnpaes changed the title [5.x]: [5.x]: 5.3.6 - Adding a second matrix entry even when locked to maximum 1 Sep 2, 2024
brandonkelly added a commit that referenced this issue Sep 2, 2024
@brandonkelly
Copy link
Member

Thanks for reporting this! Technically the nested entry is created as soon as you press “New entry”; it’s just not fully saved (in a way that would let it be shown on the front-end) until you press “Create entry”.

I fixed this for Craft 5.4 by having the field start showing the nested entry as soon as you start editing it, rather than after pressing “Create entry”. So in the above workflow, you could easily go back and continue editing the initial entry, or explicitly delete it if you want to start fresh, without any surprises about going over the field’s Max Entries limit when saving the owner element.

@brandonkelly
Copy link
Member

Craft 5.4.0 is out with that change.

@pnpaes
Copy link
Author

pnpaes commented Sep 3, 2024 via email

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

2 participants