0

I have Webform 6.1.5 running in a D9.5 website, that has lots of other contrib modules.

Using the Webform Attachments sub-module I have some simple forms that require files to be attached to the submission. The files are being uploaded [to the temporary _sid_ folder] but not to the submission folder once the webform is submitted, nor are the files referenced in the submission. If 'preview' is enabled, the files are not visible in the preview.

Conversely, using the Webform 'Test' function, sample file attachments are uploaded and added to the submission, which is the correct behaviour.

I cannot reproduce this behaviour on a vanilla D9.5 installation, so it looks like there's a conflict [with another module] that's crept in, and I'm not sure how best to approach this. So I'd welcome any suggestions.

Things I have checked:

  • Private and Temporary files folder permissions - all fine
  • Private folder path changed from relative to absolute - no change
  • Disabled multi-language and translation modules and config (see https://www.drupal.org/project/drupal/issues/2797639 - now fixed, but you never know).
  • Changed permissions (both via Webform Access and core 'View own webform' permission)
  • Added (private) file upload to Content type - works fine and is downloadable.
  • Looked at other file upload systems - DropzoneJS and Plupload - but additional modules required to work with Webform.
  • Installed all the Webform libraries (rather than coming from CDN). No change
  • Checked PHP and DB resource settings (max_allowed_packet, max_input_vars, post_upload_size etc) - seem adequate and have added a bit more to check.
  • Have enabled Webform 'Debug' handler - file fields in submission are empty
  • No JS errors posted in the Console (EDIT: also disabled JS in browser; no change observed)
  • Have tried disabling lots of modules, especially those that could have an impact on file handling or forms; however, not much left now and no change observed.
  • There's this issue that looks similar (https://www.drupal.org/node/3118815) but there was never any follow up.
  • EDIT: also tried system in default front-end and admin themes
  • EDIT: Also uninstalled Webform module, then re-installed and created simple form with File Upload field. No change - so clearly not an issue with Webform default config.

I'm not sure where to to insert some breakpoints in the module code. Looking at webform/src/WebformSubmissionInterface.php it looks like all the functionality is inherited from Core ContentEntityInterface and EntityOwnerInterface... or whether this is a JS issue.

8
  • I am the author of drupal.org/node/3118815. Is there a load-balancer?
    – cilefen
    Jun 26, 2023 at 10:21
  • No there isn't any load balancing or caching (inc BigPipe) when behaviour observed. Same behaviour on QA/production servers and local dev.
    – Rob Carr
    Jun 26, 2023 at 10:48
  • You might want to try moving the file temp directory to a different location and see if that is the issue.
    – jrockowitz
    Jun 27, 2023 at 16:04
  • Are simple webform element file uploads working as expected?
    – jrockowitz
    Jun 27, 2023 at 16:06
  • No they're not. Emails/attachment issues was the first problem to pop up, and the root cause is that no files are associated with the submission (file fields are 'null' on preview/submission)
    – Rob Carr
    Jun 27, 2023 at 16:32

1 Answer 1

-1

Unfortunately, there is no answer.

I ripped the entire site apart, deleting most content and config, leaving just Webform and Core modules enabled, yet the problem persisted. Then I deleted the contents of all /core, /vendor, /libraries and /modules/contrib directories, then rebuilt via Composer. A few updates were pulled down for contrib and vendor files, then the file upload worked correctly.

Thank you for those that helped or suggested ways to tackle this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.