Problem/Motivation

Similar to issue #3232756 but with submission bulk archive export.
When using the file_encrypt module on a webform field and trying to download the submissions, files are not decrypted when exporting submissions.
This is because the realpath of the whole directory is used.
( // Managed files are bulk copied during an export.)

Steps to reproduce

  • Enable and configure the file_encrypt module
  • Create a webform with a managed file element
  • Configure the element so the target storage is the file_encrypt storage
  • Add a submission
  • Go to the Results > Download page of the webform
  • Check the "Download uploaded files" checkbox and export

Proposed resolution

Do a special case for encrypt streamwrapper near WebformSubmissionExporter.php#L865 and/or WebformSubmissionExporter.php#L886

For encrypt stream wrapper, we should use file_get_contents from each file uri and don't use the dir realpath

Remaining tasks

Validate that we really want a special case for encrypt here

Issue fork webform-3330236

Command icon 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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

clement.ferrier created an issue. See original summary.

clement.ferrier’s picture

Issue summary: View changes
Status: Active » Needs review
jrockowitz’s picture

I am guessing there has to be a more generic way to support other stream wrappers.

jrockowitz’s picture

The patch makes sense. I am not seeing any other approached but we might be able to streamline and isolate the file_encrypt related code.

jrockowitz’s picture

Status: Needs review » Closed (won't fix)

I tried to replicate the issue using the https://www.drupal.org/project/file_encrypt module but could not get it setup to work as expected. The module is still in alpha release. I think the patch should be used AS-IS.

JoshaHubbers’s picture

Added patch file of the diff because the diff can change.

JoshaHubbers’s picture

FileSize
3.07 KB

Added one extra check. Got an error in a form where private and encrypted files were mixed.