Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Form] Add option widget to ChoiceType#15053

Closed
bamarni wants to merge 1 commit into
symfony:2.8from
bamarni:form-choice-widget-option
Closed

[Form] Add option widget to ChoiceType#15053
bamarni wants to merge 1 commit into
symfony:2.8from
bamarni:form-choice-widget-option

Conversation

@bamarni

@bamarni bamarni commented Jun 21, 2015

Copy link
Copy Markdown
Contributor
Q A
Bug fix? [no]
New feature? [yes]
BC breaks? [no]
Deprecations? [yes]
Tests pass? [yes]
Fixed tickets #6602
License MIT

Adding the behavior described here #6602, with another approach regarding radios and checkboxes though. When trying to implement it I noticed that the "multiple" option was kinda conflicting with the radio and checkbox widgets, because its value is implicit with them. So I think it would be better to stick to a more generic widget called "expanded", and the multiple option will decide whether it's a radio or a checkbox, it's similar to what we have currently and easier to implement. What do you think @webmozart?

Then I'll only need to rebase the old changes in #8112 about the entity type and it should be ok :)

@webmozart

Copy link
Copy Markdown
Contributor

Thanks for working on this @bamarni! You are right, the "multiple" option is implicitly set when "widget" is set. In fact, "multiple" and "expanded" should be deprecated and replaced by "widget".

As soon as "widget" is set, "multiple" and "expanded" should not have any effect.

@bamarni

bamarni commented Jun 22, 2015

Copy link
Copy Markdown
Contributor Author

What about the "text" widget then? In that case "multiple" was supposed to
decide wether it's a plain value or values separated by a delimiter.

2015-06-22 13:06 GMT+02:00 Bernhard Schussek [email protected]:

Thanks for working on this @bamarni https://github.com/bamarni! You are
right, the "multiple" option is implicitly set when "widget" is set. In
fact, "multiple" and "expanded" should be deprecated and replaced by
"widget".

As soon as "widget" is set, "multiple" and "expanded" should not have any
effect.


Reply to this email directly or view it on GitHub
#15053 (comment).

@webmozart

Copy link
Copy Markdown
Contributor

Ah good point :) Same for select, in fact. What about ignoring "multiple" then (and using a default) if "widget" is "checkbox" or "radio"?

@bamarni
bamarni force-pushed the form-choice-widget-option branch 5 times, most recently from 31591d9 to b133772 Compare July 5, 2015 10:45
@bamarni bamarni changed the title [WIP][Form] Add option widget to ChoiceType [Form] Add option widget to ChoiceType Jul 5, 2015
@bamarni

bamarni commented Jul 5, 2015

Copy link
Copy Markdown
Contributor Author

@webmozart : While switching to "radio/checkbox" widgets I've faced an issue when adding a normalizer for the "multiple" option (cyclic reference). I think the only way to keep full BC here is to make the 'widget' option normalizing 'expanded' and 'multiple', without touching the code behind all this. Then we'll update the code when breaking BC, and set a normalizer for "multiple". What do you think? (cf. second commit).

@bamarni
bamarni force-pushed the form-choice-widget-option branch from b133772 to a63e3c2 Compare July 5, 2015 10:55
@Koc

Koc commented Sep 28, 2015

Copy link
Copy Markdown
Contributor

Any change for getting this merged in 2.8?

@fabpot

fabpot commented Sep 28, 2015

Copy link
Copy Markdown
Member

@Koc Unfortunately, we are waiting for @webmozart review.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return ''; ?

@bamarni
bamarni force-pushed the form-choice-widget-option branch 2 times, most recently from 8fcf9fa to 296ec8d Compare November 29, 2015 09:27
@bamarni

bamarni commented Nov 29, 2015

Copy link
Copy Markdown
Contributor Author

I just rebased and added more tests. According to the roadmap, now this can only land in the 3.X series right?

@bamarni
bamarni force-pushed the form-choice-widget-option branch from 296ec8d to 5477d08 Compare November 29, 2015 10:09
@bamarni
bamarni force-pushed the form-choice-widget-option branch from 5477d08 to 02b1768 Compare November 30, 2015 09:47
@fabpot

fabpot commented Jan 27, 2016

Copy link
Copy Markdown
Member

@webmozart Can you have a look at this one? The related issue is very old now with quite a few supporters. If we want it for 3.1, we should finish it as soon as possible.

@bamarni

bamarni commented Jan 27, 2016

Copy link
Copy Markdown
Contributor Author

@fabpot 👍 From my pov except for the rebase it's finished, I was just waiting for feedback.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should have tests for other delimiters too.

@bamarni

bamarni commented Feb 1, 2016

Copy link
Copy Markdown
Contributor Author

@fabpot @xabbuh : I've rebased it against master here #17646, really looking forward to have this in 3.1, let me know if there's anything still missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants