Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
YAML Form file upload or document upload fields are not working since the beta-25 update. I have also tested development versions and they do not work either. If an upload field is present on the form it does not submit and keeps refreshing the page with all of the information. No log is made of any error. I had the captcha module on, but turning it off makes no difference.
To reproduce try the job application template provided with YamlForm.
Issue fork webform-2833759
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
jrockowitz CreditAttribution: jrockowitz commentedI can't reproduce this issue via the latest dev release.
These are the steps I am taking to try to reproduce this issue.
Comment #3
asad.hasan CreditAttribution: asad.hasan commentedThanks for your reply @jrockowitz
Here is the yaml source for the form in question. Even though I have made the upload field a flat field with no need to select resume type in this version, it didn't work in its original configuration:
Comment #4
jrockowitz CreditAttribution: jrockowitz commentedYour form works fine for me.
Do you have the private files directory configured?
Is there anything being logged (/admin/reports/dblog) or in the Status Report (/admin/reports/status).
Comment #5
jrockowitz CreditAttribution: jrockowitz commentedCan you replicate the issue via https://simplytest.me/project/drupal/8.2.x?add[]=yamlform?
Comment #6
asad.hasan CreditAttribution: asad.hasan commentedI will try to replicate it with that site. There is nothing being logged in the status report.
Comment #7
jrockowitz CreditAttribution: jrockowitz commentedComment #8
jrockowitz CreditAttribution: jrockowitz at The Big Blue House commentedComment #9
JeroenTI can reproduce this error. In my theme the template input--submit.html.twig was overriden and the HTML of the buttons was changed from to
Comment #10
JeroenTTo reproduce this error:
Create a webform with an upload field.
In your theme override the input--submit.html.twig to something like:
When you try to submit the webform now, the page refreshes and nothing happens.
In the validate function of the webform, the triggering element is the upload button of the file field.
Not sure if this is a webform bug or a drupal core bug.
Comment #11
jrockowitz CreditAttribution: jrockowitz at The Big Blue House commentedThe Webform module is just using core's ManagedFile element with a little extra code to convert the uploaded File entity to just the file's fid when the uploaded file is saved to the DB.
@JeroenT What theme/base theme are you using?
Comment #12
JeroenT@jrockowitz,
I'm using a custom build theme. That's why the button templates were overridden.
Comment #13
jrockowitz CreditAttribution: jrockowitz at The Big Blue House commentedI think this is a core bug. Can you reproduce this issue using core's Contact module with a file field.?
Comment #14
JeroenTI was unable to reproduce this bug using core's contact module.
Comment #15
jrockowitz CreditAttribution: jrockowitz at The Big Blue House commentedIf more people have theme related issues, we might need to create a documentation page to address these specific and ongoing issues.
Comment #16
KilianM CreditAttribution: KilianM commentedI got the same problem on my form :
If I remove document_file or enable ajax on the form i got no problem.
I use a custom theme but I don't override the webform templates.
Comment #17
jrockowitz CreditAttribution: jrockowitz at The Big Blue House commentedAre you still seeing the issue with just...
Are you able to replicate this issue using the Bartik theme?
If your custom theme is causing the problem, you need to fix your custom theme.
Comment #18
KilianM CreditAttribution: KilianM commentedI have the same problem with just the document file element only and the bartik theme.
Theme: Bartik 8.5.1
Drupal: 8.5.1
Webform: 8.x-5.0-rc10+10-dev
Comment #19
jrockowitz CreditAttribution: jrockowitz at The Big Blue House commentedAre you able to replicate the problem via https://simplytest.me?
Comment #20
KilianM CreditAttribution: KilianM commentedCan we configure private files on simplytest ?
I just tried to remove all custom modules and themes and I still have the same error.
Locally with a new Drupal I don't have the error though.
Could this be due to an update of the module ?
I created this form with Webform 8.x-5.0-beta11
I will try to uninstall all contribution modules to see if there is a conflict.
Comment #21
KilianM CreditAttribution: KilianM commentedOK so even after removing all the contribution modules, custom themes and custom modules I still have the error.
I can send you the code and db for testing if needed.
Comment #22
jrockowitz CreditAttribution: jrockowitz at The Big Blue House commentedPlease do not send me your DB. I just need to know how to replicate the issue.
Comment #23
jrockowitz CreditAttribution: jrockowitz at The Big Blue House commentedMarking as can't reproduce. Please reopen with an example webform and configuration that can be used to reproduce this issue.