Notice: Undefined index upon download when attachment element's #access set to FALSE

Created on 24 April 2024, 8 months ago

Problem/Motivation

When downloading attachments from a submission, an error occurs if an attachment webform element's #access property was set to FALSE.

Steps to reproduce

- Create a webform
- Add an attachment element to it (like a managed_file element)
- Create and attach a webform handler that sets the #access property to FALSE on this element (or maybe prevent access to it through its configuration, I did not test it that way)
- Try downloading all the files using this module

Proposed resolution

Modify \Drupal\webform_all_download\Controller\WebformDownloadAllController::download_download() to add an isset() check before trying to access the element's key in the webform submission data array.

🐛 Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

🇫🇷France arousseau

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024