timlovrecic / Webform-Protected-Downloads

Recreation of Webform Protected Downloads for Drupal 8
5 stars 8 forks source link

Token not getting printed #2

Open Chris-Archer-Upbeat opened 6 years ago

Chris-Archer-Upbeat commented 6 years ago

When I try and print the token in either a message or email the token is blank.

[webform_submission:protected_download_url]

The culprit seems to be around $replacements[$original] = $link; on line 93 of webform_protected_downloads.module.

If before that I do die(kint($link)); I get the correct value.

I do die(kint($replacements[$original])); after the $replacements[$original] = $link; I also get the correct value. But I soon as I do die(kint($replacements)); after the origional if of if (isset($tokens['protected_download_url']) && isset($data['entity'])) { the array is blank.

Hope this helps.

anotherjames commented 8 months ago

7 already fixed this in this repo, plus the new version of this back on https://www.drupal.org/project/webform_protected_downloads incorporates the fix.