Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -532,11 +532,12 @@ public function submit($submittedData, $clearMissing = true) | |
$submittedData = null; | ||
} elseif (is_scalar($submittedData)) { | ||
$submittedData = (string) $submittedData; | ||
} elseif ($this->config->getOption('allow_file_upload')) { | ||
// no-op | ||
} elseif ($this->config->getRequestHandler()->isFileUpload($submittedData)) { | ||
} elseif (!$this->config->getOption('allow_file_upload') && $this->config->getRequestHandler()->isFileUpload($submittedData)) { | ||
$submittedData = null; | ||
$this->transformationFailure = new TransformationFailedException('Submitted data was expected to be text or number, file upload given.'); | ||
} elseif (\is_array($submittedData) && !$this->config->getCompound() && !$this->config->hasOption('multiple')) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
ewgRa
Contributor
|
||
$submittedData = null; | ||
$this->transformationFailure = new TransformationFailedException('Submitted data was expected to be text or number, array given.'); | ||
} | ||
|
||
$dispatcher = $this->config->getEventDispatcher(); | ||
|
@nicolas-grekas hello,
I’m using the form for JSON validation in my project, so I do json decode of request content and do form->submit with this array. But after this update one of my fields, which array of arrays failed with
Submitted data was expected to be text or number, array given.
Here is an example of what I try to set in a field:
I tried to use choice field type with multiple true parameter. But values could be only strings or numbers. Because this is feature of submit method custom field type and transformers won't help in this situation. So looks like I need to change input format?