We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Symfony version(s) affected: 3.4.24
Description After upgrading from Symfony 3.4.12 to 3.4.24 the form type throws validation errors.
How to reproduce I have this entity:
class Lead{ //more code /** * @var string * * @ORM\Column(type="string", length=60) * */ private $loanPurpose; //more code }
And the corresponding FormType (Note i'm not enforcing any data type)
class LeadType extends AbstractType{ public function buildForm(FormBuilderInterface $builder, array $options) { $builder ->add('loanPurpose') //more fields added } public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults(array( 'data_class' => Lead::class )); } }
Then, I have a controller where I get a json content like this:
{ "loanPurpose":["Purpose1", "Purpose2", "Purpose3"] }
And I process it like this:
$data = json_decode($request->getContent(), true); $lead = new Lead(); $form = $this->createForm(LeadType::class, $lead); $form->submit($data, true); if($form->isValid()) { //Convert array to string "Purpose1,Purpose2,Purpose3" $lead->setLeanPurpose(implode(",", $lead->getLeanPurpose())); $em->persist($lead); $em->flush(); }
This code works perfectly on 3.4.12, but after upgrade to 3.4.24 it throws leanPurpose: "This value is not valid"
leanPurpose: "This value is not valid"
What is going on?
The text was updated successfully, but these errors were encountered:
This seems to be the same problem as reported in multiple other issues:
#30125 #29841 #29905 ...
caused by #29307
Sorry, something went wrong.
closing as explained by @dmaicher
No branches or pull requests
Symfony version(s) affected: 3.4.24
Description
After upgrading from Symfony 3.4.12 to 3.4.24 the form type throws validation errors.
How to reproduce
I have this entity:
And the corresponding FormType (Note i'm not enforcing any data type)
Then, I have a controller where I get a json content like this:
And I process it like this:
This code works perfectly on 3.4.12, but after upgrade to 3.4.24 it throws
leanPurpose: "This value is not valid"
What is going on?
The text was updated successfully, but these errors were encountered: