-
Notifications
You must be signed in to change notification settings - Fork 642
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]: Bug saving a matrix block #12422
Comments
Is any information in the I’m having trouble replicating on my end, but it’s likely because I do not entirely understand how to reproduce. Are you seeing this error when creating a matrix field? Or when editing a matrix field for an entry? |
Sure ill post it. When i tried to recreate the error today it just gave me an correct error below the input field:
|
Yeah, it looks like the name of your fields just got too long.
Can you try a shorter name (or just the handle) and see if that works for you? |
I have solved the issue but I thought I should report this. Somehow it half saved my matrix fields. So they did not appear in the back end but if I tried to add them it would give the error "a field with this handle already exists". They also existed in the database but where not visible in the field edit page. I cant reproduce the error this time if it it happens again ill report it here. |
Ah, sorry, I missed that initially. Appreciate you reporting! I dug a little deeper and could reproduce and see what was going on. In the process of saving a matrix field, when one of the handles is too long, the I’m still working out how best to fix this at the moment. We’ll update here when we have a fix ready. |
Currently, matrix handle length validation doesn't include the block type handle in the length, this makes it possible for you to create an overall field handle that's longer than the DB will allow. When this occurs things get left in a bad state, where some fields are saved and others fail. This fixes that issue by adding validation to matrix field handles to make sure they're not too long when including the block type handle in the field name. Fixes #12422
Craft 3.7.63 and 4.3.6 are out with a fix for this, via #12501. |
Currently, matrix handle length validation doesn't include the block type handle in the length, this makes it possible for you to create an overall field handle that's longer than the DB will allow. When this occurs things get left in a bad state, where some fields are saved and others fail. This fixes that issue by adding validation to matrix field handles to make sure they're not too long when including the block type handle in the field name. Fixes #12422
What happened?
Description
I was building a large matrix however it seemed to save fields to the database but not fully so they did not show in the actual matrix or while editing the field.
Steps to reproduce
Expected behavior
I expect the fields got half saved however this results in a "broken" matrix field.
Actual behavior
Saved "shadow" fields in my matrix.
Craft CMS version
4.3.1
PHP version
8.1
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
The text was updated successfully, but these errors were encountered: