strakers / zendesk-drupal-webform

Adds the ability to create Zendesk tickets from Drupal Webforms
https://packagist.org/packages/strakez/zendesk-webform
MIT License
2 stars 4 forks source link

File attachments for file fields limited to one file #37

Closed strakers closed 3 years ago

strakers commented 3 years ago

Originally submitted by @gretel-gutierrez

33

image image

$submission_field[0] was always null. It is not an array, I changed from $submission_field[0] to $submission_field to get fid of the file

strakers commented 3 years ago

Referenced response:

thanks for pointing this out! Looks like this was an oversight on my part.

The $submission_fields variable type depends on whether the form field is set to accept only 1 (not array) or multiple values (is array). In my case, I almost always allow multiple files for upload, but this is not the case for everyone/every case.

Though, rather than accepting this commit outright, I suggest that a conditional clause needs to be inserted to check the variable type (array or not) prior to loading the file. This way, both use cases can be covered.

strakers commented 3 years ago

Resolved in v1.1.0