You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
WebformInheritTask does not correctly inherit files #338
The WebformInherit-task does not correctly handle inheriting file-elements data.
Reproduce
Create a Maestro flow with a WebformInherit-task that inherits an earlier submission.
Add a file element, say document_file, with a limit of one file to both webforms.
Open the inherit task and see in the logs that something went wrong.
Warning: foreach() argument must be of type array|object, string given in Drupal\file\Element\ManagedFile::valueCallback()
Cause
MaestroWebformInheritTask::webformSubmissionFormAlter() inherits submission data by setting default values. When a singular file is uploaded the submission data value is a string.
Default value expects an array, c.f. WebformManagedFileBase::setDefaultValue().
Fix
Cast to array when default value is being set on any type of file element.
Test
Same as reproduce but with different result:
Create a Maestro flow with a WebformInherit-task that inherits an earlier submission.
Add a file element, say document_file, with a limit of one file to both webforms.
Open the inherit task and see that the file is correctly inherited.
@ds-bellcom This is superseded by #352. The change in the PR relating to that issue will inadvertently solve this issue!
@jekuaitk eller @gBarlach vil I ikke lukke de issues og evt. PR, som ikke længere er aktuelle, således at vi kun har de issues der stadig er aktuelle tilbage?
Activity
ds-bellcom commentedon Aug 25, 2026
@OS2Forms/koordinationsgruppe som skrevet inde på #339, så estimerer vi 1 time til review på denne opgave.
jekuaitk commentedon Sep 15, 2026
@ds-bellcom This is superseded by #352. The change in the PR relating to that issue will inadvertently solve this issue!
ds-bellcom commentedon Sep 15, 2026
@jekuaitk eller @gBarlach vil I ikke lukke de issues og evt. PR, som ikke længere er aktuelle, således at vi kun har de issues der stadig er aktuelle tilbage?