Gravity forms is unable to modify the required status of a fileupload field.
Test A:
All fileupload fields were set to required in the form editor. The pre_render was user to set all fileuploads to:
$field['isRequired'] = 0;
result > the fields were still required
Test B:
All fileupload fields were set to default (un-required) in the form editor. The pre_render was user to set all fileuploads to:
$field['isRequired'] = 1;
result > the fields were still not required (Although an asterisk did appear on the form).
Sample code:
add_filter( "gform_pre_render", 'gfpr_populate_by_lead' );
function gfpr_populate_by_lead( $form ) {
foreach ( $form['fields'] as &$field ) {
switch ( $field['type'] ) {
case 'fileupload':
$field['isRequired'] = 1;
break;
default:
}
return $form;
}
Could you confirm this bug? Perhaps there is an alternative function to achieve the same result?