Allow uploading files during submission of a webform.
1 unresolved thread
Closes #3503564
Merge request reports
Activity
added 1 commit
- 05da548a - Test that an error is returned when trying to associate an uploaded file with the wrong element.
added 1 commit
- 4712144e - Test that validation errors are returned for disallowed extensions and oversized files.
94 94 return $this->validationErrors; 95 95 } 96 96 97 /** 98 * Returns the validation error that corresponds to the given element. 99 * 100 * @param string|null $elementId 101 * The ID of the Webform element for which to return the validation error, 102 * or NULL to return the general validation error. 103 * 104 * @return \Drupal\graphql_webform\Model\WebformSubmissionValidationError 105 * The validation error. If no error exists for the given element ID yet, an 106 * empty error object is returned. 107 */ 108 public function getValidationError(?string $elementId): WebformSubmissionValidationError { 109 return $this->validationErrors[$elementId] ?? new WebformSubmissionValidationError([], $elementId); - Comment on lines +108 to +109
The name
getValidationError
might be worth reconsidering, since:- We already have
getValidationErrors
which creates similar naming - The current name doesn't clearly reflect its dual behavior:
- Sometimes it retrieves an error from state
- Sometimes it creates a new (unpersisted) error
This could potentially mislead developers into assuming an error existed in state when
getValidationError
actually created a fresh one. - We already have
Please register or sign in to reply