In my installation I have some taxonomy term with some additional fields, and I'm using field_group to display them.

When I'm going to a taxonomy term page and the term has some empty fields I get the following error:
"The website encountered an unexpected error. Please try again later."

In reports I found the following error:

Recoverable fatal error: Argument 1 passed to Drupal\Core\Render\Element::children() must be of the type array, null given, called in /modules/field_group/field_group.module on line 227 and defined in Drupal\Core\Render\Element::children() (line 76 of /core/lib/Drupal/Core/Render/Element.php).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Zekvyrin created an issue. See original summary.

nils.destoop’s picture

Status: Active » Fixed

Hi, this problem should be fixed in latest dev. The code causing bugs was not needed anymore (left over of d7 functionality), and is now removed.

  • zuuperman committed 42e2432 on 8.x-1.x
    Issue #2634976: Fatal Error if a group contains empty elements
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

Anonymous’s picture

Status: Closed (fixed) » Active

I would like to open this issue back up. I am suffering from the same problem with a node display. It seems that if a field group contains fields that don't have any values or content it causes the fatal error quoted in the original post to appear.

In my case, I have a field group (HTML element) added to a custom view mode display. The three fields inside it are empty on X page and the fatal error occurs. If I add a value to at least one of the fields on X page, there is no longer an issue.

Anonymous’s picture

Status: Active » Closed (fixed)

Ah! After reviewing this issue again, I realize this is indeed resolved on the 8.x-1.x-dev branch. It is still an open issue on 8.x-1.0-rc4. I will close this issue again but let me know if this should be presented as a new issue for the rc4 branch.

sittard’s picture

I'm also getting the same error (copied below) with 8.x-1.0-rc4

Recoverable fatal error: Argument 1 passed to Drupal\Core\Render\Element::children() must be of the type array, null given, called in /modules/field_group/field_group.module on line 227 and defined in Drupal\Core\Render\Element::children() (line 71 of /core/lib/Drupal/Core/Render/Element.php).

Zekvyrin’s picture

@sittard: as hexagoncircle said, it's commited in the latest dev branch.

latest Recommended release (rc4) doesn't contain this fix.
I guess a future rc or stable release will contain it but until then you can use the dev.

geerlingguy’s picture

I'm uploading a patch file for the commit that fixes this issue, mostly so those wanting to build sites with a stable release and just this patch (instead of switching to dev) using composer or drush make can do so more easily. Issue is still fixed, and just awaits a new release of the module.

ressa’s picture

I just tested the patch file posted in #9 and it works perfectly. Thanks for sharing @geerlingguy!

ressa’s picture

Perhaps it is worth considering a new recommended release, to get a patch like this one included?

ressa’s picture

A new version of the module has been released, so the patch from #9 is no longer needed.