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

[4.x]: Reordering entries in a matrix field in a category doesn't save the new position #11419

Closed
PiessensLander opened this issue Jun 10, 2022 · 2 comments

Comments

@PiessensLander
Copy link

What happened?

Description

I'm experiencing some unexpected behavior when using an entry field within a matrix that's used in a category. When I want to reorganize or replace some or all entries in the matrix field, it always changes back to the initial state. For example, when replacing selected entries in the matrix field, they change back to the original entries after saving the category. This behavior also occurs when reorganizing the order of the selected entries. I did however notice that the same matrix field works perfectly fine in an entry, as well as in a draft of a category. This issue is also reflected on the frontend. It's not just a visual bug.

Steps to reproduce

  1. Create a new matrix field
  2. Add a field for entries
  3. Add the matrix field to a category
  4. Add a few entries to the matrix field
  5. Save the category
  6. Edit the ordering of the selected entries in the matrix block
  7. (optional) remove some or all selected entries
  8. Save the category

Expected behavior

The matrix field updates the ordering of the selected entries

Actual behavior

The matrix field goes back to the initial state

Craft CMS version

4.0.4

PHP version

8.1.5

Operating system and version

MacOS 12.4

Database type and version

MySQL 5.7.34

Image driver and version

GD 8.1.5

Installed plugins and versions

  • Asset Rev 7.0.0
  • CP Field Inspect 1.4.4
  • Element API 3.0.0
  • Feed Me 5.0.4
  • Knock Knock 2.0.0-beta.1
  • Redactor 3.0.0
  • SEOmatic 4.0.1
  • Super Table 3.0.0-beta.5
  • Typed link field 2.1.3-rc
  • Videos 3.0.0-beta.1
@brandonkelly
Copy link
Member

Thanks for reporting that! Turns out it wasn’t just relational fields, but any changes made to existing blocks. Fixed now for the next release.

To get the fix early, change your craftcms/cms requirement in composer.json to "dev-develop as 4.0.4" and run composer update.

@brandonkelly
Copy link
Member

Craft 4.0.5 is out now with that fix.

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

No branches or pull requests

2 participants