I am using Field Group 3.x-dev with Drupal 8.7.1 and get hundreds of notices in watchdog looking like:

Notice: Undefined property: stdClass::$context in Drupal\field_group\FieldGroupFormatterPluginManager->getInstance() (line 72 ...

The messages are related to the following Classes: $context, $label, $format, $weight, $mode.

Comments

Publishing Future created an issue. See original summary.

bbombachini’s picture

I was having the same notice, then I realized there was a database update pending.

publishing future’s picture

Thank you for the hint. But unfortunately I get the messages without any pending database update.

bailey86’s picture

nils.destoop’s picture

Status: Active » Postponed (maintainer needs more info)

Seems like your config is a bit broken, as all of those properties are required field_group properties. I suggest you export the config and fix the broken config in the yml files. I don't think it's related with the missing region, as that one was a property that was added in latest releases. The notices you are getting are properties that always existed.

If you need more help, you will need to do some debugging by placing breakpoints at the places that are giving the notices.

nils.destoop’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)
kasey_mk’s picture

On Drupal 9.2.2 with Paragraphs 1.12.0 and Field Group 3.1.0 I get these errors when I have a term with an Entity reference revisions field for Paragraphs. If I edit the term and add or edit one or more Paragraphs and then save the term without collapsing the Paragraph edit subforms, I get these errors:

Notice: Undefined property: stdClass::$children in Drupal\field_group\FormatterHelper::formProcess() (line 92 of modules/contrib/field_group/src/FormatterHelper.php).
Warning: Invalid argument supplied for foreach() in Drupal\field_group\FormatterHelper::formProcess() (line 92 of modules/contrib/field_group/src/FormatterHelper.php).
Notice: Undefined property: stdClass::$format_type in field_group_field_group_form_process() (line 380 of modules/contrib/field_group/field_group.module).
Notice: Undefined property: stdClass::$mode in field_group_field_group_form_process() (line 381 of modules/contrib/field_group/field_group.module).
Notice: Undefined property: stdClass::$context in field_group_field_group_form_process() (line 382 of modules/contrib/field_group/field_group.module).
Notice: Undefined property: stdClass::$weight in field_group_field_group_form_process() (line 387 of modules/contrib/field_group/field_group.module).
Notice: Undefined property: stdClass::$format_type in field_group_field_group_form_process() (line 392 of modules/contrib/field_group/field_group.module).
Notice: Undefined property: stdClass::$label in field_group_field_group_form_process() (line 393 of modules/contrib/field_group/field_group.module).
Notice: Undefined property: stdClass::$context in Drupal\field_group\FieldGroupFormatterPluginManager->getInstance() (line 72 of modules/contrib/field_group/src/FieldGroupFormatterPluginManager.php).

My Paragraph form display is pretty complex, using Tab and HTML element field groups.

If I collapse the Paragraphs subforms before saving the term, I do not see these errors. There doesn't seem to be any problem with my data; just lots of these notices.

kasey_mk’s picture

StatusFileSize
new3.89 KB

This patch adds some checks for empty properties before trying to use them, which makes the error messages I was getting go away.

kasey_mk’s picture

Status: Closed (cannot reproduce) » Needs review
yassersamman’s picture

Status: Needs review » Needs work

Thanks for the patch, but imho, and correct me if I'm wrong, the patch in #8 isn't really a solution, the issue is still there, it's literally just avoiding empty objects to hide messages. I think when checking for empty objects, we should provide an "else" for the "if" to handle object variables to be used in the rest of the code.

Also, if you are using the patch in#8, no need to use the patch here:
https://www.drupal.org/project/field_group/issues/3059614#comment-14012954

yassersamman’s picture

StatusFileSize
new3.79 KB

Here is a re-roll for the patch in #8

joseph.olstad’s picture

upgrading to 3.4 fixed this without patch

nils.destoop’s picture

Status: Needs work » Closed (outdated)