- Issue created by @kiwimind
- π¬π§United Kingdom james.williams
Thanks, good question ... I don't believe this is currently possible, as yes, the token is currently only available once the submission exists - which is after hidden fields are built or populated. So at the moment custom code would be necessary. But if you or anyone else wants to have a go at implementing this ability into the module codebase, I can see the value and would accept it & help with getting it in place! It wouldn't necessarily need to use tokens either; fundamentally you just want to be able to reference the file that was available at the time of submission, so that when the file or handler config changes, the reference or value in the submission is unchanged.
- π¬π§United Kingdom kiwimind
Thanks very much for the prompt response.
I'll have a think about this. If there's time on this project then I may well have a crack, otherwise we may have to rely on revisions by date.
- πΊπΈUnited States devkinetic
Maybe instead of adding the file in the handler directly, we could leverage media via a reference field, and then grab the file how file_download_link does.
- π¬π§United Kingdom james.williams
@devkinetic using a file field on a media entity (or similar) means the file is actually publicly accessible at a specific URL, plus one of the fundamental features of webform_protected_downloads is that the files can be uploaded by admins as part of the webform config itself rather than needing to set up things elsewhere first. (see the comparison of similar modules β .)
So I'd be reluctant to head in that direction, unless mitigation for those two things can be made alongside any such change.