core icon indicating copy to clipboard operation
core copied to clipboard

Form Handler - A form can be submitted without providing any value for required checkboxes and multiselects

Open gabbydotCMS opened this issue 14 years ago • 2 comments

Required field validation is not working for checkboxes and multiselects in form structures.

The method: public void validateContentlet(Contentlet contentlet,List cats)throws DotContentletValidationException in com.dotcms.content.elasticsearch.business.ESContentletAPIImpl does this to validate checkboxes and multiselects:

if(!UtilMethods.isSet(o) && (st.getStructureType() != (Structure.STRUCTURETYPEFORM))) { cve.addRequiredField(field); hasError = true; continue; }

therefore, when the structure is a form, it ignores the required condition for these type of fields.

This is a Show Stopper for the Secure Form project. We've temporarly commented out the "&& (st.getStructureType() != (Structure.STRUCTURETYPEFORM)" in that if to be able to continue with our tests while R&D defines a permanent fix.

gabbydotCMS avatar Jul 06 '12 16:07 gabbydotCMS

Secure Form environment is running dotCMS 2.0 over postgres

gabbydotCMS avatar Jul 06 '12 16:07 gabbydotCMS

required now respected on submit

DeanGonzalez avatar Aug 10 '12 15:08 DeanGonzalez