craftcms/cms

[5.x]: 502 error thrown when entry is saved with validation errors

Closed this issue · 5 comments

What happened?

Description

I have a matrix field with an entry type that has a dropdown field.
The dropdown field has no default value selected in the field settings.

When you go to save the entry you see a 502 error and no errors are logged.

If you set a value manually, or set a default on the field this does not happen.

Steps to reproduce

  1. Create a dropdown field without a default option/value
  2. Add the field to an entry
  3. Add the entry to a matrix field
  4. Try and save an entry using the matrix field with the dropdown field with no value set

Note this field in my case is on another tab in the field settings.

Expected behavior

Should save

Actual behavior

502 error

Craft CMS version

5.0.5

PHP version

8.2.15

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

Actually - I think this may be related to validation of fields.

See this field here has too many characters:

Screenshot 2024-04-26 at 15 14 23

When you save the entry there are no front-end validation errors and then when you save you get a 502 error.

I should also note, again this field is on a tab. I will try and test it without it being on a tab and see if it makes a difference.

Hi, thanks for reaching out! I’m having trouble understanding how to replicate this problem. Any chance you could send your composer.json, composer.lock and database export to support@craftcms.com and point to the entry where this error happens?

Thanks, @andrewhawkes! That helped!

This problem originates in the SEO plugin. If I disable it, the errors show as expected.
Screenshot 2024-04-29 at 12 41 04

Looking further into it, the problem seems to start here: https://github.com/ethercreative/seo/blob/v5.0.0-rc1/src/models/data/SeoData.php#L455. Please raise this in the plugin’s repo: https://github.com/ethercreative/seo/issues.