- install the latest version of profile2 and entity from git
- install http://drupal.org/project/field_group
- create a new custom profile type
- add field to it and put this field into a new group
- edit your profile, browse to the tab of your profile (user/1/edit/test if your profile type is called 'test'). you will note that the fields are rendered ok in their group. all good so far
- go to create a new user at admin/people/create and note that the fields are not rendered in their group/fieldset like they are in your profile. you will also see plenty of notices like # Notice: Trying to get property of non-object in field_group_fields_nest() (line 1000 of /sites/all/modules/field_group/field_group.module).
- go to the user registration form, the same thing happens, all the fields are rendered flat with the notices.
| Comment | File | Size | Author |
|---|---|---|---|
| #22 | newuserformwith.JPG | 25.36 KB | manoloka |
| #22 | newuserformwithout.JPG | 18 KB | manoloka |
| #12 | 1006464_3_profile2_field_group.patch | 1.38 KB | nils.destoop |
| #5 | Screenshot.png | 123.2 KB | Stalski |
| #5 | Screenshot-1.png | 147.26 KB | Stalski |
Comments
Comment #1
scor commentedI have a feeling there might be a better fix but this patch works for me...
Comment #2
scor commentedactually, the patch above breaks the form validation in profile2_form_validate_handler(). The best solution I found was to momentarily comment out the fieldset wrapping in the user creation/registration form. Does not look as good but at least it allows field_group to work, and the form validates alright.
Comment #3
fagoThis is probably a problem in the field_group module, as profile2 just uses the field API attachers as documented. Perhaps field group has troubles if the field API forms are not attached to the outer most $form but in a form element?
Comment #4
Stalski commentedHmm good question. You could be right, i'll have to check this.
Comment #5
Stalski commentedHmm could not find any problem nor notice. Maybe fixed by drupal core upgrades or somthing.
see attached screenshots.
Comment #6
scor commentedyou didn't visit the right places. please follow the detailed instructions I gave in #0.
Comment #7
nils.destoop commentedIt's a problem caused by profile2.
Profile2 idd uses correctly the field api attachers. But later in the code, he does this:
But by doing that, the whole rendering from our groups has been broken.
I'm now trying to debug a bit, so i can find what exactly makes it break.
Comment #8
nils.destoop commentedFound the problem: form_process_fieldset removes our groups.
Comment #9
nils.destoop commentedWe renamed our storage to #fieldgroups instead of #groups. I committed this change, but we'll do some testing on all our forms. Would be nice if other people also review, if everything is still working.
Comment #10
scor commentedplease provide an actual patch.
Comment #11
Stalski commentedReverted it. Did not work all the way. see http://drupal.org/cvs?commit=480146 for more info
Comment #12
nils.destoop commentedIn attachment you can find a new patch. It looks like this one doesn't break anything.
Comment #13
Stalski commentedTested. Works everywhere here. If the patch validates, we'll commit it unless somebody experience an issue with this refactoring?
Comment #14
fagoThere is comment left in the patch.
Comment #15
Stalski commentedThis comment will be removed in next commit, together with the patched code.
Comment #16
Stalski commentedThat comment will go indeed, but it looks fine to me. Everything keeps working as it should.
Comment #17
Stalski commentedAll is committed and tested.
Comment #18
Stalski commentedSee a related issue and new bug at #1043834: Field Group module just does not work with profiles 2
Comment #19
Stalski commentedComment #20
manoloka commentedHi there,
I guess this patch doesn't apply anymore ... however I'm finding the same issue nowadays
Comment #21
manoloka commentedComment #22
manoloka commentedI've noticed it happens when you check the "show during account registration" option in the profile type for more of one profile
Comment #23
Pete B commentedCross-referencing #2849333: Conflict with core fieldset use of #groups causing issues - I think the patch there will solve this issue too, although I haven't tested it with profile2. Is anyone in a position to try it?
Comment #25
nils.destoop commented