Closed (fixed)
Project:
Field Group
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Aug 2011 at 02:55 UTC
Updated:
10 Oct 2011 at 19:51 UTC
I get this notices/warnings in the checkout Process and also in some views with drupal commerce installed, using Field Group in the product entity.
Notice: Trying to get property of non-object in field_group_remove_empty_form_groups() (line 936 of C:\damp\www\...\sites\all\modules\field_group\field_group.module).
Warning: array_flip() [function.array-flip]: The argument should be an array in field_group_remove_empty_form_groups() (line 936 of C:\damp\www\...\sites\all\modules\field_group\field_group.module).
Warning: Invalid argument supplied for foreach() in element_children() (line 6134 of C:\damp\www\...\includes\common.inc).
Any hint?
Comments
Comment #1
bradhawkins commentedExact same problem for me (also using drupal commerce).
Comment #2
Stalski commentedI don't have any problems with fieldgroup in drupal commerce.
I can see in the error it's occurring for forms. Could you explain how I can reproduce this?
Comment #3
sonuku commentedAdd something to cart
Go to checkout
Click submit without filling in any details.
Produces error for me.
Multiple Warning: array_flip() expects parameter 1 to be array, null given in field_group_remove_empty_form_groups() (line 938 of [...removed...]/sites/all/modules/field_group/field_group.module).
Comment #4
EndEd commentedIn my case i used field groups in the product entity and in the product display content type. I get this error in the checkout process, in some views that uses the product entity fields and even working with rules :/
Comment #5
mikehie commentedI also get this notices/warnings when filling out the profile information for new user (profile2 + geofield + geocode + openlayers modules activated). It happens when I try to switch new country field (provided by geofield module).
This warnings & notices shown 6 times for each occurrence.
Comment #6
restyler commentedExactly same problem on registration page (profile2 + date fields there)
Comment #7
vasikesubscribe. the same with #1251510-3: Trying to get property of non-object
Comment #8
jason ruyle commentedsubscribing
Comment #9
dqdI sadly have to confirm the bug. Warning occurs here on every page load 30 times.
... on fresh Drupal 7.8 with latest devs of views, ctools, token, entity, profile 2 a.s.o
Comment #10
Stalski commentedThis is fixed and pushed.
This fix has fixed two bugs:
- the one reported here: there was need to check empty groups as the groups did not come from fieldgroup but from the commerce client profile or something. So any module can declare a fieldset and add it to the #groups property. Fieldgroup thus thought it had to handle that one too, but it didn't. So a check there if that element comes from fieldgroup, fixed it.
- I also saw that I did not have declared any fieldgroup and I got the error, just because commerce entity had added 3 fieldsets in #groups property. So now, there is a check to see if any #fieldgroups in general are there and acted accordingly.
This is a huge performance boost because of the unneeded prerenders.
- Edit - extra information can be found in field_group.api.php
Ready for testing.
Comment #11
Stalski commentedI also would like to add for people using commerce that it makes not much sense to create fieldgroups on the product entity as it is displayed through the product display. The way commerce does things, is exposing the variant fields into the product display so they are handled as separate fields. Use fieldgroups in the product display all you want but imo not in the product entity.
If I said anything stupid here, let me know as I am trying to fully understand commerce as well.
Comment #12
dqdBug fixes work smoothly, Stalski. Messages disappeared.
Comment #13
Stalski commentedGreat! Thx for the feedback. Other who can confirm this?
Comment #14
vasikei still have errors with commerce.
i have fieldgroups defined within Commerce Profiles entity, Order profile as well and for Checkout i have both Chechout panes with and without fieldset wrapper.
Is this a commerce issue?
Comment #15
Stalski commentedAh, that's what I did not test yet. So in this case the commerce profile entity has field_groups.
I'll test this and get back to you.
Thx for the feedback
Comment #16
vasikealso for Order entity
Comment #17
vasikeany updates for orders and commerce profiles field groups in checkout?
Comment #18
vasikesolution that worked for me:
just a checking isset($group->children) before the $group_children array_flip():
Comment #19
vasikeComment #20
Stalski commentedThx. Fixed and pushed to git.
Comment #21.0
(not verified) commentedForgot that one and could be usefull to see whats happening