Account created on 12 May 2007, almost 18 years ago
#

Recent comments

🇨🇦Canada quadbyte

I'm using webform_rest 4.2.0, with Drupal 10.4.3.

I updated from #61 to patch #107 and noticed the "validators" code was not working as expected for me.
I'm uploading a mp3 to a webform, and it was failing because Drupal's default extensions is set as follow:
const DEFAULT_EXTENSIONS = 'jpg jpeg gif png txt doc xls pdf ppt pps odt ods odp';
The extensions specified in the webform element were not respected.

I have attached an updated version of patch #107 which worked for my use case. I only altered the getElementValidators() method to properly read the element's properties: extensions and file size limit.

I really hope this feature will be merged soon, as I have been battling with this many times to keep this functionality working while still updating Drupal and dependencies.

Hope that helps!

🇨🇦Canada quadbyte

FYI, patch no longer works with Drupal 10.3.0. I have not had the time to look into.

Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service 'mime_type.guesser'

🇨🇦Canada quadbyte

Validation code seems indeed suspicious. I'm getting "Array to string conversion" warnings.
It seems we are sending to validation an array of validators instead of an array of fields?
Don't know much about validation, so I might be totally wrong.

Warning: Array to string conversion in Drupal\file\Plugin\rest\resource\FileUploadResource->validate() (line 45 of /var/www/experience/dev/web/core/modules/rest/src/Plugin/rest/resource/EntityResourceValidationTrait.php)
#0 /var/www/experience/dev/web/core/includes/bootstrap.inc(164): _drupal_error_handler_real()
#1 [internal function]: _drupal_error_handler()
#2 /var/www/experience/dev/web/core/modules/rest/src/Plugin/rest/resource/EntityResourceValidationTrait.php(45): array_diff()
#3 /var/www/experience/dev/web/modules/contrib/webform_rest/src/Plugin/rest/resource/WebformFileUploadResource.php(129): Drupal\file\Plugin\rest\resource\FileUploadResource->validate()
#4 [internal function]: Drupal\webform_rest\Plugin\rest\resource\WebformFileUploadResource->post()
🇨🇦Canada quadbyte

@gdurglishvili Error seems pretty explicit and is not in the module but in the code you use to send the file.
Server is expecting a POST request, and you are doing a GET.

🇨🇦Canada quadbyte

Sorry I had wrong copy/paste in my initial post
The missing one is : "view feedback message entities"

Production build 0.71.5 2024