Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
No Bootstrap markup is rendered for label set as false#18504
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
| <divclass="{{block('form_group_class') }}"> | ||
| {{- form_widget(form) -}} | ||
| {{- form_errors(form) -}} | ||
| {%setdisplayMarkup=form.children|length==0orform.vars.labelis notsame as(false) %} |
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.
You should not change the behavior whenform.children|length == 0 imo.
This is not a bug, other templates show the label, and may be part of the work in progress feature in#17609.
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 think it's a bug displaying aform-group inside aform-group. The label i still shown - the markup is not rendered when the label is set to false.
I cannot see how this will be solved in your pr. It looks like another feature.
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.
Actually I misread the condition, IIUC you force the label (evenfalse) to be printed when there is no child.
So I guess this should be right.
fabpot commentedJun 14, 2016
LGTM. @jongotlin Can you add some tests to ensure that we don't break this again in the future? |
HeahDude commentedJun 29, 2016
Ref#18850. |
soullivaneuh commentedJun 30, 2016
@jongotlin Did you check your PR respect the second sample of#18850 (comment)? ->add('test', TextType::class, ['mapped' =>false,'label' =>false,'attr' => ['placeholder' =>'My label goes here', ]]) |
soullivaneuh commentedJun 30, 2016
Also:
|
soullivaneuh commentedJun 30, 2016
This does not see my issue. I download your patch and tried with this form config: publicfunctionbuildForm(FormBuilderInterface$builder,array$options){$builder ->add('domain',null, ['label' =>'ssl_certificate.form.domain','translation_domain' =>'front', ]) ->add('subdomains', CollectionType::class, ['label' =>'ssl_certificate.form.subdomains','translation_domain' =>'front','type' => TextType::class,'allow_add' =>true,'allow_delete' =>true,'prototype' =>true,'options' => ['label' =>false,'text_suffix' =>'','attr' => ['class' =>'subdomain-domain', ], ], ]) ;} Result: This solve not this issue:#18850 (comment) |
soullivaneuh commentedJun 30, 2016
Or the issue is not really related and in this case#18850 should be re-opened. |
soullivaneuh commentedJun 30, 2016
Please see this alternative:#19247 |
jongotlin commentedJul 1, 2016
Thanks@soullivaneuh. I didn't think of the CollectionType-example you provided. I'll look into how it can be solved. |
jongotlin commentedJul 1, 2016
Not sure how to solve@soullivaneuh s issue. I guess also the prototype is affected. Anyone having an idea where to start? |
soullivaneuh commentedJul 1, 2016
@jongotlin I check vertical form, I have no issue about this at all. The only solution I found is to correct the column classes in#19247. |
fabpot commentedJul 28, 2016
Closing in favor of#19247 |


When using horizontal Bootstrap forms and setting

'label' => falsefor a custom form type theform_rowrenders an ugly markupThis pr fixes that and make the form look like this
