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.. ?

CommentFileSizeAuthor
#2 multipage_form_file-2832550-2.patch957 bytesjrockowitz

Comments

wheelercreek created an issue. See original summary.

jrockowitz’s picture

StatusFileSize
new957 bytes

Yep, 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.

jrockowitz’s picture

Status: Active » Needs review
jrockowitz’s picture

Status: Needs review » Fixed

Patch is pretty safe so I am going to apply it.

You can test the fix by downloading or checking out the latest dev release.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.