8000 Undocumented BC break - choice field type template by TomAdam · Pull Request #5263 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Undocumented BC break - choice field type template #5263

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

Closed
wants to merge 1 commit into from

Conversation

TomAdam
Copy link
Contributor
@TomAdam TomAdam commented Aug 14, 2012

The upgrade notes for the choice field template are out of date. They currently state:

The `choices` variable now contains `ChoiceView` objects with two getters,
getValue() and getLabel(), to access the choice data.

However these methods do not exist. I assume this is the result of a rollback to maintain BC?

In addition to this, the _form_is_choice_selected twig function has been removed and replaced with a filter called selectedchoice. This is an undocumented BC break. I have attached an update to the notes to reflect these changes.

@travisbot
Copy link

This pull request passes (merged 9e3e589 into 826f512).

@fabpot
Copy link
Member
fabpot commented Aug 15, 2012

ping @bschussek

<option value="{{ choice.value }}"{% if _form_is_choice_selected(form, choice) %} selected="selected"{% endif %}>
{{ choice.label }}
{% for choice, label in choices %}
<option value="{{ choice }}"{% if choice is selectedchoice(form) %} selected="selected"{% endif %}>
Copy link
Contributor

Choose a reason for hiding this comment

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

should read {{ choice.value }} and selectedchoice(value)

@webmozart
Copy link
Contributor

Looks good apart from my comment. Thanks for fixing this!

fabpot added a commit that referenced this pull request Aug 16, 2012
Commits
-------

9e3e589 Alter upgrade notes with changes to _form_is_choice_selected twig function

Discussion
----------

Undocumented BC break - choice field type template

The upgrade notes for the choice field template are out of date. They currently state:

```
The `choices` variable now contains `ChoiceView` objects with two getters,
getValue() and getLabel(), to access the choice data.
```

However these methods do not exist. I assume this is the result of a rollback to maintain BC?

In addition to this, the `_form_is_choice_selected` twig function has been removed and replaced with a filter called `selectedchoice`. This is an undocumented BC break. I have attached an update to the notes to reflect these changes.

---------------------------------------------------------------------------

by fabpot at 2012-08-15T17:20:35Z

ping @bschussek

---------------------------------------------------------------------------

by bschussek at 2012-08-16T17:36:22Z

Looks good apart from my comment. Thanks for fixing this!
@TomAdam
Copy link
Contributor Author
TomAdam commented Aug 16, 2012

We seem to have crossed our streams! It's gone into the doc as {{ choice.value }} on the second edit that @bschussek suggested, when it should be {{ value }}, as this picks up the fields actual value rather than the current choices value.

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
0