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]: Invalid Configuration error after removing a field that a section used as a conditional #11526

Closed
andyra opened this issue Jun 29, 2022 · 3 comments

Comments

@andyra
Copy link

andyra commented Jun 29, 2022

What happened?

Description

I have a section in my Craft install that uses a radio field's value to conditionally show other fields. I decided I didn't need the radio field anymore, so I deleted it before deleting the conditionals on the section settings page. Now I'm unable to:

  • Create a new entry for that section
  • Edit existing entries in that section
  • Edit the section settings

I get this error:

Invalid Configuration – [yii\base\InvalidConfigException](http://www.yiiframework.com/doc-2.0/yii-base-invalidconfigexception.html)
Invalid field UUID: 23e0243c-314c-442e-9557-dcd723962e0a

That makes sense—it's looking for a field that doesn't exist anymore, but there's not a way to "undo" that change. I tried creating the field again, but it has a different ID, so it doesn't fix the problem.

Steps to reproduce

  1. Create a section with two fields: 1) a text field and 2) a radio field with values "foo" and "bar"
  2. In the section settings, make the text field only visible if the radio field value is "foo"
  3. Delete the radio field
  4. Visit the section settings page

Expected behavior

A couple ideas:

  • Condition should automatically be removed once a field is removed
  • Condition should fall back to true if the original field can't be found

Actual behavior

Can't access the section's content

Craft CMS version

4.1.0.2

PHP version

8.1.4

Operating system and version

Darwin 21.5.0

Database type and version

MySQL 8.0.28

Image driver and version

GD 8.1.4

Installed plugins and versions

  • Control Panel Nav 4.0.2
  • DigitalOcean Spaces Filesystem 2.0.0
  • Expanded Singles 2.0.0-beta.1
  • FeedMe 5.0.4
  • Redactor 3.0.1
  • SuperTable 3.0.0-beta.6
@brandonkelly
Copy link
Member

Thanks for reporting that! Just fixed for the next release.

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

@andyra
Copy link
Author

andyra commented Jul 1, 2022

Yay! Much appreciated—thanks!

@brandonkelly
Copy link
Member

Craft 4.1.1 is out 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