I started getting a ton of the following notices after I updated to 1.2 earlier today.
Notice: Trying to get property of non-object in field_group_field_group_pre_render() (line 660 of /sites/all/modules/field_group/field_group.module). Backtrace:
field_group_field_group_pre_render(Array, Array, Array) field_group.module:2021
field_group_pre_render(Array, Array, Array) field_group.module:1991
field_group_fields_nest(Array, NULL) field_group.module:1884
field_group_build_entity_groups(Array, 'form') field_group.module:1854
field_group_form_pre_render(Array) common.inc:5843
drupal_render(Array) common.inc:5871
drupal_render(Array) common.inc:5871
drupal_render(Array) common.inc:5963
render(Array) page.tpl.php:80
include('/htdocs/sites/default/themes/mytheme/templates/page.tpl.php') theme.inc:1517
theme_render_template('sites/default/themes/mytheme/templates/page.tpl.php', Array) theme.inc:1201
theme('page', Array) common.inc:5864
drupal_render(Array) common.inc:5726
drupal_render_page(Array) common.inc:2675
drupal_deliver_html_page(Array) common.inc:2563
drupal_deliver_page(Array, '') menu.inc:532
menu_execute_active_handler() index.php:21
And I was wondering if there was a typo on line 636 shouldn't
function field_group_field_group_pre_render(& $element, &$group, & $form) {
Be:
function field_group_field_group_pre_render(&$element, &$group, & $form) {
Notice the space between the & and $element.
Thanks in advance.
Comment | File | Size | Author |
---|---|---|---|
#49 | 2078201-49-fieldgroup_notice_flood.patch | 971 bytes | xaviemirmon |
#27 | 2078201-27-fieldgroup_notice_flood.patch | 2.56 KB | eneko1907 |
#16 | 2078201-14-fieldgroup_notice_flood.patch | 1.29 KB | DeFr |
#10 | Capture.PNG | 280 KB | c3rberus |
Comments
Comment #1
nils.destoop CreditAttribution: nils.destoop commentedHmm. You sure the line numbers are correct?
On line 660, there is nothing of code, only documentation of the field_group_pre_render_fieldset function.
Also the other line numbers don't match.
Comment #2
Dave ReidI can confirm we're also getting a bunch of notices with using ECK entities with Inline Entity Form as a result of the update:
Comment #3
Dave ReidSeems to be a problem with Inline Entity Form is being used. The entity that is inside the inline form doesn't have any field groups on it, but somehow that's what is causing all the errors.
Comment #4
ath.galanis CreditAttribution: ath.galanis commentedThe same problem for me too. (after update to 7.x-1.2).
Comment #5
royerd CreditAttribution: royerd commentedYes, me as well. Yikes.
Comment #6
Christopher Riley CreditAttribution: Christopher Riley commentedI downgraded to 7.x-1.1+68-dev and the problems went away. As soon as I get my dev server back up and running I can run more extensive tests but I can't do that in production.
Comment #7
Stalski CreditAttribution: Stalski commentedI can't seem to reproduce this. I tried with upgrades from 7.x-2.x to 7.x-1.2 and from 7.x-1.1 to 7.x-1.2.
Looking at the code on the lines Dave subscribes, it seems like it's no group object at all, most likely a NULL value. Group->group_name is always known if the group was succesfully loaded from the database.
Can anyone give some more pointers on how to reproduce?
Comment #8
ath.galanis CreditAttribution: ath.galanis commentedScenario that reprodusing the above notises
On Drupal 7.23 with Flag 7.x-1.2 AND String Overrides 7.x-1.8 module enabled
Go Configuration > Regional & Language > String Overrides
Update/change anything or just click save
Go instantly to your home page and you get the notises
The fact is that I'm not get the notises anymore (with the above scenario).
Comment #9
Christopher Riley CreditAttribution: Christopher Riley commentedI was getting it on the users screen as well as the checkout panes in Drupal Commerce.
Comment #10
c3rberus CreditAttribution: c3rberus commentedI just updated to the latest version of field_group running latest version of Drupal 7 and am getting the same errors.
Something real funky going on, the content type that I am working with has a file field, when I add a new node with a file content, my screen is spammed with the "Notice: Trying to get property of non-object in field_group_field_group_pre_render() (line 636 of /var/www/sites/all/modules/field_group/field_group.module)." but the file gets added.
When I drill into the node, I also cannot see the file even though my display settings are set to show the genetic file.
Nodes under the same content type that have been added prior to the field_group update, show the file there.
Just trying to provide as much information as I can to help resolve this.
This same content type makes use of field_collection and conditional_fields, though up until this update there were no problems.
Comment #11
c3rberus CreditAttribution: c3rberus commentedJust an update, the issue regarding the "file" not getting added is not related to this error (it was an issue with my conditions on the file field).
I also noticed that if I update to the latest --dev version instead of the stable, the errors stop but I also lose the ability to drag fields around.
Comment #12
fortis CreditAttribution: fortis commentedI am getting the same errors with update from 1.1 to 1.2,
rolled back to 1.1
Comment #13
Plascual CreditAttribution: Plascual commentedSame thing here. I mostly get the messages when I'm on the Verify pane of Drupal Commerce.
How may I help?
Comment #14
T.Mardi CreditAttribution: T.Mardi commentedI've also started to get these errors since upgrading to 1.2. They mostly appear on Commerce checkout pages:
Comment #15
wrd CreditAttribution: wrd commentedI'm actually getting these notices even on a content type from which I've removed all field groups. The only content type on which I'm seeing these notices is one that uses a Field Collection. (The Field Collection also does not have any field groups.)
Comment #16
DeFr CreditAttribution: DeFr commentedOK so what seems to be going on is: field_group_fields_nest assumes that everything mentionned in $element['#groups'] is a field group. Core is already using '#groups' though in form_process_fieldset, putting an array there instead, every time a fieldset using the standard FAPI #group property is used.
This seems to be known and is documented in the field_group.api.php, and seems to be the reason why there's both '#fieldgroups' property, but I'm not sure why it wasn't used. Using it seems to fix the problem, attaching a proof-of-concept patch.
Comment #17
wrd CreditAttribution: wrd commented#16 seems to clear the problem up for me.
Comment #18
daniel-san CreditAttribution: daniel-san commented#16 worked.
I was getting the notices on the content type's Manage Fields page and all of the field groups were not showing up on the Node add or edit page. The notices/errors have cleared and the field groups are now showing on node edit page.
Comment #19
glynster CreditAttribution: glynster commentedI can confirm this fixed the issue for us as well.
Comment #20
eneko1907 CreditAttribution: eneko1907 commented#16 did the trick for me too -- no more notices or vanishing tabs. THANKS.
Comment #21
micbar CreditAttribution: micbar commented#16 works fine. I think this is rtbc.
Comment #22
Dom. CreditAttribution: Dom. commentedTo #16:
I would also add this one lign 1841:
to
Comment #23
DeFr CreditAttribution: DeFr commentedThat one is following a straight assignment to $element['#groups'] four line above, so at this point $element['#groups'] is guaranteed to be the same as $element['#fieldgroups'] and I'm not too worried about it.
The call in
feels a bit unsafe, but that code is only hit for non-form case, so it should be immune to FAPI-conflict.
Comment #24
Dom. CreditAttribution: Dom. commentedThanks for reply and precision, sorry for the time it took you !
Comment #25
Jelle_SThis has been fixed in the past, but was then reverted two commits later (see #1006464: field_group not working on user registration and add people form of profile2). This commit also seems to re-introduce the '#groups' array key.
FYI / FWIW: I can confirm this patch is working
Comment #26
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedi can confirm it works too
Comment #27
eneko1907 CreditAttribution: eneko1907 commentedActually, with #16, I am still seeing a bunch of notices -fewer than before-.
Here is one from watchdog:
Referrer http://drupal-root/test-field-group-notices
Message Notice: Trying to get property of non-object in field_group_fields_nest() (line 1959 of [path]/modules/contrib/field_group/field_group.module).
I took care of this after doing a similar replacement around line 1959 (#groups to #fieldgroups)
and now I do not see notices - tested twice.
here is a revised patch.. let me know if that helps some of you.
inigo
Comment #28
dmitrii CreditAttribution: dmitrii commented#27 works for me
Comment #29
Stalski CreditAttribution: Stalski commentedHi all,
The solution to use something other than #groups is the best one. We had some kind of workaround in the past to avoid a clash between fieldgroup #groups and the #groups used by several modules to create a fieldset with properties (E.g. user profile history).
I'll review the patch so I can take a look at how we merge the #fieldgroups into #groups before. But I think the proposed patch is the good approach.
Comment #30
c3rberus CreditAttribution: c3rberus commentedThis is good news, waiting for this to get committed to dev so I can update :)
Comment #31
hcderaad CreditAttribution: hcderaad commented#27 works!
Comment #32
John Pitcairn CreditAttribution: John Pitcairn commentedSigh. Patch at #27 works here.No it doesn't. Still getting errors when viewing some nodes with an embedded field collection.
Comment #33
micbar CreditAttribution: micbar commentedComment #34
nils.destoop CreditAttribution: nils.destoop commentedI committed #27 to dev, as renaming #groups to #fieldgroups is the correct way to go. This way most of notices are already gone, we will now check for embedded field collection.
Comment #35
nils.destoop CreditAttribution: nils.destoop commentedCan't seem to reproduce the notices when viewing a node with embedded field collection.
Can you say the display settings of your collection?
Comment #36
John Pitcairn CreditAttribution: John Pitcairn commentedIt's a multivalue field, and output is highly customized. I think this is one I'll have to investigate myself, the problem may be mine ;-)
Comment #37
Dave ReidWe're encountering this using the Inline entity form multiple value widget for entity reference fields to refer to one type type on another. The parent node type has field group configuration added to it, but the inline node type does not have any field groups.
Comment #38
MVRider CreditAttribution: MVRider commentedI have the same issue as as #37 and will be watching this thread.
Comment #39
TimeBandit CreditAttribution: TimeBandit commentedWas getting same errors with nested embedded field collections after update. DEV update from 2013/09/11 eliminated the errors for me.
Comment #40
nils.destoop CreditAttribution: nils.destoop commentedI'm setting this to fixed then. People already confirmed that it was fixed for inline entity form, now also for embedded field collection.
Comment #41
nils.destoop CreditAttribution: nils.destoop commentedComment #42
Sam152 CreditAttribution: Sam152 commentedCan you commit this against a stable release? The current stable release is broken and people might not want to be on the dev branch.
Comment #43
Christopher Riley CreditAttribution: Christopher Riley commentedPatch fixed my issues and gave me control of the server again. Can we please get this committed?
Comment #44
nils.destoop CreditAttribution: nils.destoop commentedMoving this back to fixed. A 1.3 stable is gonna be released soon.
Comment #45
Ravi.malviya2000 CreditAttribution: Ravi.malviya2000 commentedi have userd #34 and resolved problem as renaming #groups to #fieldgroups is the correct way to go. This way most of notices are already gone, we will now check for embedded field collection.
Comment #46
prorokxp CreditAttribution: prorokxp commentedI have simillar ton of notices on the commerce "Review order page" (checkout/10/review)
product has Inline Entitie Single widget.
all modules are up to date.
field_group_table + field_group modules as you can see:
Notice: Trying to get property of non-object in field_group_table_field_group_pre_render() (line 154 of /sites/all/modules/field_group_table/field_group_table.module).
Notice: Trying to get property of non-object in _field_group_get_html_classes() (line 2057 of /sites/all/modules/field_group/field_group.module).
Notice: Trying to get property of non-object in _field_group_get_html_classes() (line 2059 of /sites/all/modules/field_group/field_group.module).
Notice: Trying to get property of non-object in _field_group_get_html_classes() (line 2063 of /sites/all/modules/field_group/field_group.module).
Warning: Attempt to assign property of non-object in field_group_pre_render_prepare() (line 617 of /sites/all/modules/field_group/field_group.module).
Warning: Attempt to assign property of non-object in field_group_pre_render_prepare() (line 618 of /sites/all/modules/field_group/field_group.module).
Notice: Trying to get property of non-object in field_group_field_group_pre_render() (line 636 of /sites/all/modules/field_group/field_group.module).
Notice: Trying to get property of non-object in field_group_field_group_pre_render() (line 646 of /sites/all/modules/field_group/field_group.module).
Notice: Trying to get property of non-object in field_group_field_group_pre_render() (line 649 of /sites/all/modules/field_group/field_group.module).
Notice: Trying to get property of non-object in field_group_field_group_pre_render() (line 652 of /sites/all/modules/field_group/field_group.module).
Notice: Trying to get property of non-object in field_group_table_field_group_pre_render() (line 154 of /sites/all/modules/field_group_table/field_group_table.module).
Notice: Trying to get property of non-object in _field_group_get_html_classes() (line 2057 of /sites/all/modules/field_group/field_group.module).
Notice: Trying to get property of non-object in _field_group_get_html_classes() (line 2059 of /sites/all/modules/field_group/field_group.module).
Notice: Trying to get property of non-object in _field_group_get_html_classes() (line 2063 of /sites/all/modules/field_group/field_group.module).
Comment #47
prorokxp CreditAttribution: prorokxp commentedsorry, my mistake.. was not upgraded actually. notices has gone in 1.3
thanks. great work
Comment #48
lauriiiAfter succesful upgrade to 1.3, i'm getting these errors:
Comment #49
xaviemirmonI have created a patch which fixes the notices I was getting. Let me know if that works.
Comment #51
Dave ReidPlease file a separate issue for the bug and patch in #48 and #49 since this issue was marked as fixed, and the PHP notices reported in #48 are different from the ones originally reported.
Comment #57
Dave Reid