-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Form] Fixed regression: Empty values were not accepted anymore for collapsed, optional choice fields #14465
New issue
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
Conversation
webmozart
commented
Apr 24, 2015
Q | A |
---|---|
Bug fix? | yes |
New feature? | no |
BC breaks? | no |
Deprecations? | no |
Tests pass? | yes |
Fixed tickets | #14393 |
License | MIT |
Doc PR | - |
'multiple' => false, | ||
'expanded' => false, | ||
'choices' => array( | ||
'EMPTY_CHOICE' => 'Empty', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't this have to use choices_as_values: true to not use the deprecated functionality? I guess the trigger_error is missing for the old choices structure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. I'll add the trigger_error statement in a separate PR.
…ollapsed, optional choice fields
…ymore for collapsed, optional choice fields (webmozart) This PR was merged into the 2.7 branch. Discussion ---------- [Form] Fixed regression: Empty values were not accepted anymore for collapsed, optional choice fields | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #14393 | License | MIT | Doc PR | - Commits ------- 7997f24 [Form] Fixed regression: Empty values were not accepted anymore for collapsed, optional choice fields
I still cannot submit optional entity filed (extended choice field) using empty_value with doctrine on Symfony 2.7 (e60f715). Field definition: $builder->add('dealer', 'entity', array(
'label' => 'useraccount.label.dealer',
'class' => 'MyAppBundle:Subject',
'choice_label' => 'label',
'empty_value' => '',
'multiple' => false,
'required' => false
)); After submitting empty value i get this error:
It seems like Symfony is trying to find Subject entity using empty string as id for dealer field:
|
see #14583 |
Type::GUID can be used as entity ID and is Connection::PARAM_STR_ARRAY when submitting form with required set to FALSE and empty entity with Type::GUID as entity ID, we still receive an SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for uuid: "" in the PostgreSQL Platform for example. symfony/symfony#14465 ???