When using a multi-page form, if we have filefields on one of the pages we're running into an expected array warning:
Warning: end() expects parameter 1 to be array, null given in Drupal\file\Element\ManagedFile::validateManagedFile() (line 400 of core/modules/file/src/Element/ManagedFile.php).
Drupal\file\Element\ManagedFile::validateManagedFile(Array, Object, Array) (Line: 505)
Drupal\yamlform\Plugin\YamlFormElement\YamlFormManagedFileBase::validate(Array, Object, Array)
call_user_func_array(Array, Array) (Line: 1024)
Drupal\yamlform\YamlFormSubmissionForm::hiddenElementValidate(Array, Object, Array)
call_user_func_array(Array, Array) (Line: 277)
Drupal\Core\Form\FormValidator->doValidateForm(Array, Object) (Line: 235)
Drupal\Core\Form\FormValidator->doValidateForm(Array, Object) (Line: 235)
Drupal\Core\Form\FormValidator->doValidateForm(Array, Object) (Line: 235)
This just started happening with the latest Drupal update / YAMLform update.. ?
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | multipage_form_file-2832550-2.patch | 957 bytes | jrockowitz |
Comments
Comment #2
jrockowitz commentedYep, I can duplicate the issue by creating a multistep form with a file upload on the first page.
Let's see if the attached patch works.
Comment #3
jrockowitz commentedComment #4
jrockowitz commentedPatch is pretty safe so I am going to apply it.
You can test the fix by downloading or checking out the latest dev release.