craftcms/cms

[5.x]: matrix: max entries setting does not seem to update on block deletion event when used in global set

Closed this issue · 2 comments

What happened?

Description

When deleting a matrix block in a global set, it seems like there's an issue with reconsidering the field's max entries setting. The buttons are not greyed out anymore (indicating that I should be able to add a block again), but Craft wont let me actually create a new block. I first have to resave the entry/reload the page, only then can I create a new block.

Steps to reproduce

  1. Create matrix field with a max entries setting of 1.
  2. Assign matrix field to global set.
  3. Create block and save global set.
  4. Delete block (without saving the global set)
  5. Try to create a new block in this matrix once again.

Expected behavior

Since the max entries criteria is not being met and I'm able to correctly press the add-block-button, Craft should create a new block of this type.

Actual behavior

Nothing happens, no block is being created.

Craft CMS version

Solo 5.1.9

PHP version

8.2.15

Operating system and version

MacOS 14.1.1 (23B81)

Database type and version

MySQL 8.0.33

Image driver and version

Imagick 3.7.0 (ImageMagick 6.9.11-60)

Installed plugins and versions

  • CKEditor 4.0.6
  • Dashboard Begone 3.0.0
  • Formie 3.0.0-beta.14
  • SEOmatic 5.0.3

Thanks for reporting that! Fixed for the next release.

Craft 5.1.10 is out now with that fix.