Problem/Motivation
Inline files held in <a> tags that are uploaded into "Advanced HTML/Text" elements are stored in temporary mode, and can be deleted when cron runs.
Steps to reproduce
1. Create a webform with an "Advanced HTML/Text" element
2. Using a module such as Editor File Upload, upload a file into this element.
3. Examine the file in the database and see that it is marked as temporary.
If "Delete temporary files after" (/admin/config/media/file-system) is not set to "Never", the uploaded file may get deleted on a future cron run.
Proposed resolution
Broaden _webform_parse_file_uuids() to also look for linked files in <a> tags, not just inside <img> tags.
Remaining tasks
Patch, review.
User interface changes
None.
API changes
None.
Data model changes
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | webform-inline-hyperlink-files-3168051-2.patch | 2.05 KB | chrisolof |
Comments
Comment #2
chrisolofPatch attached. Changes
_webform_parse_file_uuids()such that it also looks for files inside of<a>tags.It was tempting to do exactly what
_editor_parse_file_uuids()does, but unfortunately_webform_parse_file_uuids()isn't always given an HTML snippet. For instance, _webform_get_array_file_uuids() hands it YAML. As such I've also updated_webform_parse_file_uuids()'s documentation to reflect that it's designed to work with any sort of text string, not just an HTML snippet.Comment #4
jrockowitz commented