Closed gretel-gutierrez closed 3 years ago
@gretel-gutierrez thanks for pointing this out! Looks like this was an oversight on my part.
The $submission_fields
variable type depends on whether the form field is set to accept only 1 (not array) or multiple values (is array). In my case, I almost always allow multiple files for upload, but this is not the case for everyone/every case.
Though, rather than accepting this commit outright, I suggest that a conditional clause needs to be inserted to check the variable type (array or not) prior to loading the file. This way, both use cases can be covered.
$submission_field[0] was always null. It is not an array, I changed from $submission_field[0] to $submission_field to get fid of the file