Closed techpeace closed 7 years ago
While the optional
option isn't listed in the documentation, it does appear in the example app.
Yeah, it's something we need to decide on.
In the early prototype of the CMS, we used the optional: true
flag to mark a field as optional. In the current version when @cassiozen implemented validations, he mimicked the general behavior of HTML form validations, and optional fields are marked using required: false
.
I personally think optional: true
makes more sense when being required is the default, but it would be a change that would require updating existing config files
Required field validation is documented here. Opened a PR to update the example config.
Required: false doesn't seem to work for relation widgets. Maybe I'm missing something?
@luczaki114 It's working for me 😕. If you can reach out in our Spectrum Chat with a repo link or example, I'd be happy to look at it!
I'm having this same issue
https://github.com/smithtimmytim/brightlycolored.org/blob/master/admin/config.yml
@smithtimmytim Can you reach out in our Gitter chat since this issue is already closed? Also, it looks like there is a typo on the required
setting for your body
field, maybe that is causing it.
This had to do with a service worker cache issue, not the CMS. All fixed now. Big thanks to @talves for the help.
required:false
for image field doesnt work
- { label: "Featured Image", name: "thumbnail", widget: "image", required:false }
Still, UI requires the field
- Do you want to request a feature or report a bug?
Report a bug.
- What is the current behavior?
Marking a field as optional in the
config.yml
does not make the field optional.- If the current behavior is a bug, please provide the steps to reproduce.
optional: true
to a field for a collection inconfig.yml
:- What is the expected behavior?
The field should be optional when creating a post.
- What is the actual behavior?
The field is still required:
- Please mention your node.js, and operating system version.
node version: 6.9.5 OS: Mac OS X 10.12.3
Using Middleman