decap-cms icon indicating copy to clipboard operation
decap-cms copied to clipboard

Vaildation error is not shown on collapsed objects

Open martinjagodic opened this issue 4 years ago • 5 comments

Describe the bug If a field inside a collapsed object fires a validation error, the entry will not be saved. This is the correct behavior, but the problem is, that there is no indication of where the error occurs.

To Reproduce Steps to reproduce the behavior. For example:

  1. Create an object field and add collapsed: true
  2. Add a required sub-field
  3. Leave the sub-field empty and try to save the entry.
  4. See a general error notification at the top and observe that there is no notification on the collapsed object

Expected behavior If a field is collapsed and it includes objects with validation errors, it should also be treated as a field with an error. It should get a red border and an explanation text in red color.

Screenshots Collapsed - there is no indication that a required filed is empty in services object Screenshot 2021-07-19 at 11 12 35

Uncollapsed Screenshot 2021-07-19 at 11 12 46

Applicable Versions:

  • Netlify CMS version: 2.10.147
  • Git provider: GitHub
  • OS: MacOS 11.4 (20F71)
  • Browser version: Brave 1.26

CMS configuration Example configuration for a collapsed object with a required string field. This happens on any global configuration I believe.

{name: services, widget: object, collapsed: true, summary: fields: [
  {name: title, widget: string}
]}

martinjagodic avatar Jul 19 '21 09:07 martinjagodic

Hi, can I fix this one?

evelew avatar Oct 04 '21 20:10 evelew

Thanks @evelew, a possible place to start is here https://github.com/netlify/netlify-cms/blob/6d801ae092a6763bd751cb82bd238c7c12b31884/packages/netlify-cms-widget-object/src/ObjectControl.js#L66

Also see our contribution guide https://github.com/netlify/netlify-cms/blob/master/CONTRIBUTING.md

erezrokah avatar Oct 05 '21 09:10 erezrokah

@erezrokah ok, thank you!

evelew avatar Oct 05 '21 22:10 evelew

Hi! If this is still available, id like to try to fix it :)

emirodriguezalc avatar May 02 '25 12:05 emirodriguezalc

Hi! i am currently unable to work on this, so id prefer to have it assigned to someone else. Ill come back as soon as i have capacity

emirodriguezalc avatar May 15 '25 15:05 emirodriguezalc