h5p-editor-php-library icon indicating copy to clipboard operation
h5p-editor-php-library copied to clipboard

HFP-3851 Fix select field validation

Open otacke opened this issue 1 year ago • 0 comments

When merged in, will fix the validate function of a select field to return true if the field is optional and nothing (-) is chosen.

Close to 10 years ago (!?) the select field’s validate function was amended to allow choosing - which is equivalent to not choosing anything. The new code works fine if the field is mandatory and nothing is chosen - the return value of validate is false. However, if the field is optional and nothing is chosen, currently the return value of validate is undefined.

otacke avatar Jan 04 '24 21:01 otacke