Closed (fixed)
Project:
Webform
Version:
8.x-5.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
25 Jul 2018 at 20:36 UTC
Updated:
24 Aug 2018 at 10:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
gg4 commentedComment #3
jrockowitz commentedThe attached webform replicates this issue.
Comment #4
jrockowitz commentedThe attached patch adds support for multiple files but raises the question, How should multiple files be structured?
Below is how the patch is sending multiple files.
I am open to suggestions.
Here are the options that I can think of right now...
Comment #5
gg4 commentedLet me think about this for a sec, but what do you think about adding the
uuidto the data well?Comment #6
jrockowitz commentedI am open to anything that is useful. You are making me feel the entity references should be including uuids and labels.
Comment #7
jrockowitz commentedI think the mistake was appending the file data to the form params which should just be the raw submission data.
Files and entities should be included as meta data via '_files' and '_entities' properties.
We could use this approach and leave the old behavior ASI-IS or remove it via the first stable release of webform 8.5 or wait until webform 8.6.
Comment #8
jrockowitz commentedI think the best approach is to prefix the file element's meta data with an underscore.
The attached patch generates the below post (from /webform/test_handler_remote_post_file/test) while preserving the old 'file__*' data.
Comment #10
jrockowitz commentedComment #11
gg4 commentedI think I follow, but do you have a quick example of what this will look like if there are multiple elements allowing a combination of single and multiple files?
Comment #12
jrockowitz commentedI updated https://www.drupal.org/project/webform/issues/2988239#comment-12707154 to use more specific element keys (single_file and multiple_files).
You might need to test the patch via your specific webform.
Comment #13
gg4 commentedI think your updated comment makes this much more clear now. Thanks.
Comment #14
jrockowitz commentedI think the fids need to be included in
_single_fileand_multiple_files. This would allow developers to process only the _{element_key} fields.Comment #15
jrockowitz commentedThe attached patches adds the file id to remote post data.
Comment #16
gg4 commented+1 for that change.
Comment #17
jrockowitz commentedMarking this RTBC and I will commit this change later this week.
Comment #18
gg4 commented+1 to RTBC as well.
Comment #20
jrockowitz commented