Error: Call to undefined method Drupal\file\Entity\File::url() in Drupal\webform_dropzonejs\Element\WebformDropzonejs

Created on 14 July 2021, over 3 years ago
Updated 25 January 2023, almost 2 years ago

Hello!
Thanks for this awesome module!
My config:
drupal 9.2 + webforms 6 + you module with this path https://www.drupal.org/files/issues/2020-08-12/3164787-1.patch

The problem:
after the email with the attachment was created, I tried to go to my form Results tab but got an error message:

Error: Call to undefined method Drupal\file\Entity\File::url() in Drupal\webform_dropzonejs\Element\WebformDropzonejs::processDropzoneJs() (line 97 of modules/contrib/webform_dropzonejs/src/Element/WebformDropzonejs.php)....

I solved this problem by changing 97 lines of code in WebformDropzonejs.php to the following:

 'path' => $file->createFileUrl(FALSE),

best regards

🐛 Bug report
Status

RTBC

Version

1.0

Component

Code

Created by

🇧🇾Belarus savage1974

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024