Skip to content

[Twig][Bridge] force space between widget and label in checkbox_radio_label #15446

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 2 commits into from
Closed

[Twig][Bridge] force space between widget and label in checkbox_radio_label #15446

wants to merge 2 commits into from

Conversation

MatTheCat
Copy link
Contributor

Q A
Fixed tickets N/A
License MIT

Update

without space

to

with space

@MatTheCat
Copy link
Contributor Author

I don't know anything about xpath but I think it's not normal tests fail because of one space.

@stof
Copy link
Member

stof commented Aug 5, 2015

@MatTheCat it is normal, because this XPath query asserts the text of the label, and you now have a space in it which was not there before

@MatTheCat
Copy link
Contributor Author

Should we use normalize-space then? Or should I add the space in tests?

@xabbuh
Copy link
Member

xabbuh commented Aug 5, 2015

I think you should add the space in the test. If we used normalize-space, we would not be able to detect future regressions.

@MatTheCat
Copy link
Contributor Author

I don't get why tests are failing past PHP5.5 =/

@stof
Copy link
Member

stof commented Aug 6, 2015

@xabbuh thus it would not work. normalize-space will change multiple spaces to 1, but there would still be a difference between 1 space and none

@MatTheCat we have an issue with the deps=low and deps=high tests. @nicolas-grekas is currently working on fixing them.

@fabpot
Copy link
Member

fabpot commented Sep 14, 2015

👍

@@ -168,8 +168,7 @@
{% set label = name|humanize %}
{% endif %}
<label{% for attrname, attrvalue in label_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}>
{{- widget|raw -}}
{{- label is not sameas(false) ? label|trans({}, translation_domain) -}}
{{- widget|raw }} {{ label is not sameas(false) ? label|trans({}, translation_domain) -}}
Copy link
Member

Choose a reason for hiding this comment

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

Should be same as now that sameas is deprecated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should this be made in this PR?

Copy link
Member

Choose a reason for hiding this comment

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

Never mind, this has been fixed in the meantime in 99a1fcc.

@fabpot
Copy link
Member

fabpot commented Sep 28, 2015

Thank you @MatTheCat.

fabpot added a commit that referenced this pull request Sep 28, 2015
…ckbox_radio_label (MatTheCat)

This PR was submitted for the 2.6 branch but it was merged into the 2.7 branch instead (closes #15446).

Discussion
----------

[Twig][Bridge] force space between widget and label in checkbox_radio_label

| Q             | A
| ------------- | ---
| Fixed tickets | N/A
| License       | MIT

Update

![without space](https://cloud.githubusercontent.com/assets/1898254/9058780/481326ae-3aa4-11e5-9a8a-ebd6bf963361.png)

to

![with space](https://cloud.githubusercontent.com/assets/1898254/9058791/52184238-3aa4-11e5-854f-4a8105dacb84.png)

Commits
-------

ed9c610 [Twig][Bridge] force space between widget and label in checkbox_radio_label
@fabpot fabpot closed this Sep 28, 2015
@fabpot fabpot mentioned this pull request Oct 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants