Problem/Motivation

When I place the element on a page and move through the form, I see this error.

Error: Call to undefined method Drupal\file\Entity\File::url() in Drupal\webform_dropzonejs\Element\WebformDropzonejs::processDropzoneJs() (line 92 of /Users/andy/Sites/bhcclocalgov/docroot/modules/contrib/dropzonejs_webform/src/Element/WebformDropzonejs.php)

Steps to reproduce

  1. Set up a multiple page webform
  2. Place a dropzone webform element on the first page
  3. Place another element on the second page
  4. View the webform, Upload files and go to the next page.
  5. Next button will hang, See error above in logs, and on viewing submissions the file will not be there.

Proposed resolution

I think 'path' => $file->url(), in /src/Element/WebformDropzonejs.php line 92 should be 'path' => $file-> getFileUri(),
See https://api.drupal.org/api/drupal/core%21modules%21file%21src%21FileInte...

Remaining tasks

Make a patch.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

andybroomfield created an issue. See original summary.

andybroomfield’s picture

Issue summary: View changes

Looking closely, this is tied to having the element on a multiple page form.
Here's an example

page_one:
  '#type': wizard_page
  '#title': 'Page one'
  fieldset:
    '#type': fieldset
    '#title': Fieldset
    dropzone:
      '#type': webform_dropzonejs
      '#title': Dropzone
      '#multiple': true
page_two:
  '#type': wizard_page
  '#title': 'Page two'
  fieldset_2:
    '#type': fieldset
    '#title': 'Fieldset 2'
    some_text:
      '#type': textarea
      '#title': 'Some text'

andybroomfield’s picture

Status: Active » Needs review

Opened merge request with patch.

arno_vgh’s picture

arno_vgh’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.