kbond / ZenstruckFormBundle

Provides Twitter Bootstrap form theme, a help type extension, Ajax/Tunnel/Select2 entity form types and javascript helpers
25 stars 14 forks source link

Notice: Undefined index: group #36

Open lsv opened 9 years ago

lsv commented 9 years ago

Got a few of these, so if you "forget" to add a group to a field, then you would get the notice about group is not defined.

So added isset instead

kbond commented 9 years ago

Hmm, shouldn't every field have a group from the GroupTypeExtension? Their default value is null but they should all have the "var".

lsv commented 9 years ago

Im lazy and only set groups on not "default group" stuff.

->add('title', 'text', [
   'required' => true,
])
->add('description', 'genemu_tinymce', [
      'required' => false,
      'group' => 'Descriptions',
])
kbond commented 9 years ago

Yeah, exactly, when you specifically set a group, it defaults to null.

kbond commented 9 years ago

Did you add:

zenstruck_form:
    form_types:
        group: true

to your config?

lsv commented 9 years ago

Yes, I have

zenstruck_form:
    form_types:
        ajax_entity_controller: true
        ajax_entity: true
        group: true
kbond commented 9 years ago

Can you check that https://github.com/kbond/ZenstruckFormBundle/blob/master/Form/Extension/GroupTypeExtension.php#L26 is being called?