Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #63
The point of
WidgetHelper::addFilesToSession
was (presumably) to makeContao\Form::processFormData
behave in the same way as with the regular file upload. i.e. if email sending is enabled, Contao will either attach the uploaded file to the email or append the absolute path to the image for easy access/download (when file storing is enabled).However, this is currently not the case with the FineUploader. Any uploaded files only show up in the regular email content, with
field name: relative/file/path
. Uploaded files are not attached, nor is a direct link appended to the email by Contao.This is because
WidgetHelper::addFilesToSession
uses Symfony's Session service to write the information to the session. However, Symfony's Session stores all session data always in "session bags" with unique namespaces (see Session Data Management), not directly to$_SESSION
, in order to not interfere with other session data.Contao\Form::processFormData
however uses$_SESSION['FILES']
directly, without Symfony's Session service - thus this never worked.This PR fixes that by instead writing the session data directly to
$_SESSION['FILES']
as expected fromContao\Form::processFormData
.Note: the Symfony Session is still added via Dependency Injection to the
WidgetHelper
, even though nothing in it uses it any more. Should I remove it?