Closed Nellyaa closed 2 weeks ago
It looks like you have a field condition that referenced a relational field, but then its field type was changed to something else.
I’ve just made fields’ condition rules more defensive about that possibility for the next Craft 4 and 5 releases.
You can test to see if that helps by changing your craftcms/cms
requirement in composer.json
to:
"craftcms/cms": "5.x-dev as 5.4.6",
and then running composer update
.
Craft 4.12.6 and 5.4.7 are out with that fix. Thanks for reporting!
I updated and the pages all work fine now, thank you! Since you said it's about a condition on a field I looked deeper and found the fields that have a condition relating to the changed field.
After installing your update the fields with the "faulty" condition don't show up anymore in the entry edit pages, even if the condition was theoretically met. The condition was "show field when
The condition was still listed on the fields with the conditions in the entry type's field's settings. I had no UI indicator something was wrong here or not working. I could fix the issue by removing the "faulty" condition (which I only knew was broken due to your comment) and creating a new one with the same settings and it started working as expected again.
I understand this is much better than the previous version (erroring out). I wonder if it'd be better to delete all conditions relating to a field when it is changed though (ideally updated of course), to avoid future confusion? But that's something I noticed now that I've dealt with this issue.
@Nellyaa Good point! I just tagged Craft 4.12.6.1 and 5.4.7.1 which improves on that further by just completely ignoring condition rules if they reference an incompatible field type. (They’ll end up getting fully removed from the condition the next time the condition is saved — when you save the entry type in this case.)
What happened?
Description
I've started developing a Craft website on Craft 5.0-5.2 (unfortunately I can't remember) and then upgraded to Craft 5.4. I used URL fields, which became Link fields after the upgrade. Since the upgrade all backend edit pages of entries using the link field are broken and creating elements with a link field isn't possible anymore. I've tried nuking the database, expecting a faulty migration. I've changed the link field to something else and back, but the error persists.
The link field is used within card elements in a matrix in my case. I tried attaching it directly to the entry itself and it doesn't error/crash the edit page, I can even save URLs or phone numbers, but not assets (they get removed when I try to save them - no error showing up though).
Steps to reproduce
Expected behavior
I can edit the entry and work on link fields, saving, deleting, editing etc.
Actual behavior
The error when I try to create an element (via the button) with a link type in it within a matrix block of a new entry page:
All entry edit pages that where created prior to the update and contain a link field now show this error when you try to access them:
Craft CMS version
5.4.6
PHP version
8.2.17
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
CKEditor 4.2.0 Cookies 5.0.0 GeoMate 3.0.0 ImageOptimize 5.0.2 Mix Manifest 2.0.0 SEOmatic 5.1.4 Sprig 3.5.0