Skip to content
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

fix one to many inline table #791

Closed
wants to merge 2 commits into from
Closed

fix one to many inline table #791

wants to merge 2 commits into from

Conversation

jgrygierek
Copy link

@jgrygierek jgrygierek commented Jan 12, 2018

I am targeting this branch, because there is no BC-break.

Closes #790

Changelog

### Added
- Unnecessary table cell when using collections with **ModelHiddenType** now is hidden

Subject

Changes inside edit_orm_one_to_many_inline_table.html.twig template.

@@ -22,7 +22,8 @@ file that was distributed with this source code.
{% if nested_field.vars['required'] %}
class="required"
{% endif %}
{% if (nested_field.vars['attr']['hidden'] is defined) and (nested_field.vars['attr']['hidden']) %}
{% if (((nested_field.vars['attr']['hidden'] is defined) and (nested_field.vars['attr']['hidden']))
Copy link
Contributor

Choose a reason for hiding this comment

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

The extra parens you are adding are unnecessary because of operator precedence I think

Copy link
Author

Choose a reason for hiding this comment

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

Yes, first is totally unnecessary (habit from PHP). But second makes it more friendly to read.

@@ -22,7 +22,8 @@ file that was distributed with this source code.
{% if nested_field.vars['required'] %}
class="required"
{% endif %}
{% if (nested_field.vars['attr']['hidden'] is defined) and (nested_field.vars['attr']['hidden']) %}
{% if (((nested_field.vars['attr']['hidden'] is defined) and (nested_field.vars['attr']['hidden']))
or (nested_field.vars.sonata_admin.field_description and nested_field.vars.sonata_admin.field_description.type == 'Sonata\\AdminBundle\\Form\\Type\\ModelHiddenType')) %}
Copy link
Contributor

Choose a reason for hiding this comment

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

Please linebreak this

@jordisala1991
Copy link
Member

This template is deprecated. If any, this belongs to the admin bundle

@jgrygierek
Copy link
Author

Ok, you are right. I didn't see this^^

@jgrygierek jgrygierek closed this Jan 13, 2018
@jgrygierek jgrygierek deleted the fix-one-to-many-inline-table branch January 13, 2018 22:54
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.

None yet

3 participants