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

Skip to content

[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

Merged
merged 1 commit into from
Apr 5, 2015

Conversation

nicolas-grekas
Copy link
Member

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT
Doc PR -

@nicolas-grekas nicolas-grekas merged commit f3dbb5d into symfony:2.7 Apr 5, 2015
nicolas-grekas added a commit that referenced this pull request Apr 5, 2015
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
@nicolas-grekas nicolas-grekas deleted the fix-bc-break branch April 5, 2015 18:45
@Tobion
Copy link
Contributor

Tobion commented Apr 5, 2015

The new choice view now has the inherited label, view and data defined again for no reason.

@nicolas-grekas
Copy link
Member Author

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 :)

@webmozart
Copy link
Contributor

IIUC, this was done to fix passing "new" ChoiceView instances when methods are type-hinted against the old one, am I right?

@nicolas-grekas
Copy link
Member Author

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);
Copy link
Member

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__

Copy link
Contributor

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

Copy link
Contributor

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

Copy link
Member

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

Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants