-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Form] Fix BC break introduced in #14050 #14223
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
nicolas-grekas
commented
Apr 5, 2015
Q | A |
---|---|
Bug fix? | no |
New feature? | no |
BC breaks? | no |
Deprecations? | no |
Tests pass? | yes |
Fixed tickets | - |
License | MIT |
Doc PR | - |
This PR was merged into the 2.7 branch. Discussion ---------- [Form] Fix BC break introduced in #14050 | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Commits ------- f3dbb5d [Form] Fix BC break introduced in #14050
The new choice view now has the inherited label, view and data defined again for no reason. |
I did it this way to make the source code of the new class as close as possible to the target code in 3.0, thus ease future merges. But if this should be removed, I'm fine with it of course. I merged a lot of PRs today to fix tests. I may continue tonight until travis is back to green. But I'm really fine with re-patching on top of course, provided tests remain green :) |
IIUC, this was done to fix passing "new" |
You're right, and to allow the reverse also: providing a new ChoiceView to an old type-hinted ChoiceView |
parent::__construct($label, $value, $data); | ||
$this->data = $data; | ||
$this->value = $value; | ||
$this->label = $label; | ||
|
||
trigger_error('The '.__CLASS__.' class is deprecated since version 2.7 and will be removed in 3.0. Use Symfony\Component\Form\ChoiceList\View\ChoiceView instead.', E_USER_DEPRECATED); |
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.
this should be triggered only when get_class($this) === __CLASS__
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.
@stof no it must not because the new class does not call the parent class at all
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.
but for people extending the choice view to provide their own implementation, this would still be useful indeed
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.
@Tobion they would get the deprecation thrown by the DebugClassLoader already
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.
I'm fixing this issue in #14201.
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.
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.
Looks like we worked on the same at the same time :) See #14258 for an alternative