Netlify-cms: Saving fails *almost* silently when required fields are left empty

Created on 4 Oct 2017  ·  10Comments  ·  Source: netlify/netlify-cms

- Do you want to request a feature or report a bug?
bug

- What is the current behavior?
If a user tries to save an item with an empty required field, the save button appears to do nothing at all. If you look closely (and aren't color blind), you may notice that one or more field labels have turned red. This is the only indication of why saving fails, and it can be really easy to miss, especially if the fields in question are offscreen.

- If the current behavior is a bug, please provide the steps to reproduce.

  1. Create a new post on cms-demo. (<--That link will take you straight to the new post page.)
  2. Without adding any content, click Save.
  3. See that Title and Body labels turn red, but no other feedback is given.

- What is the expected behavior?
At minimum, a general error message that says something like, "Oops, you've missed a required field. Please complete before saving." It would also be helpful to have a more noticeable, accessible indicator on the offending fields.

- Please mention your CMS, node.js, and operating system version.
True on all versions I know of, in any browser.

good first issue

All 10 comments

I don't have any fields marked as required, still running into this issue.

Video snippet from a user test wherein this bug was seen. It's a bit confusing to watch as you only hear me speaking and not the test participant as well.

http://share.neutyp.com/1k393r2o0V1m

@dardub Do you have all of your fields marked as required: false? It's not immediately obvious that all fields are required by default.

Hi, I'd love to pick this one up if it hasn't been assigned already.

Sweet! If you have any questions, feel free to ask here or in Gitter.

I didn't realize that fields are required by default. That seems like an
anti-pattern to me. For instance in html fields are not required until
specifically added.

On Tue, Oct 3, 2017 at 4:46 PM Jessica Parsons notifications@github.com
wrote:

@dardub https://github.com/dardub Do you have all of your fields marked
as required: false? It's not immediately obvious that all fields are
required by default.


You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
https://github.com/netlify/netlify-cms/issues/649#issuecomment-334011176,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAiTPwdVwnJ2N4PPjvqng34v6RFhtsChks5sosdvgaJpZM4Ps6w3
.

@dardub totally agree.

@aquibm awesome!!

Hey @erquhart, I've done a quick first pass by surfacing up errors for fields that are required and flashing a notification when we back out of persisting the entry due to validation errors.

If we wish to flash a notification specially for empty required fields, we could modify the fieldsErrors map in the entryDraft to include a type for each error against a field rather than just a string describing the error to the user. This way, when persisting the entry we could select whether there have been any empty required field errors and flash the notification before backing out.

Please let me know if I'm headed in the right direction or if you have a better approach.

This happens for me when all the fields are complete too. Definitely seems like a bug.

@dioptre this issue centered around the old 0.x UI, if you're experiencing something like this in the current CMS (2.0 or newer), please open a new issue so we can hunt it down 👍.

Was this page helpful?
0 / 5 - 0 ratings