Problem/Motivation

After upgrading to version 8.x-3.3, the following error started to occurs on all Node Edit pages:

TypeError: Argument 1 passed to Drupal\field_group\FormatterHelper::groupElementsContainErrors() must be of the type array, null 
given, called in /code/web/modules/contrib/field_group/src/FormatterHelper.php on line 144 in Drupal\field_group\FormatterHelper::groupElementsContainErrors() (line 165 of modules/contrib/field_group/src/FormatterHelper.php).

Steps to reproduce

I upgraded the Field Group module from version 8.x-3.2 to version 8.x-3.3, and the error started to occur. Here is the full stack trace:

TypeError: Argument 1 passed to Drupal\field_group\FormatterHelper::groupElementsContainErrors() must be of the type array, null given, called in /code/web/modules/contrib/field_group/src/FormatterHelper.php on line 144 in Drupal\field_group\FormatterHelper::groupElementsContainErrors() (line 165 of modules/contrib/field_group/src/FormatterHelper.php).
Drupal\field_group\FormatterHelper::groupElementsContainErrors(NULL) (Line: 144)
Drupal\field_group\FormatterHelper::formGroupPreRender(Array)
call_user_func_array(Array, Array) (Line: 101)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 772)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 363)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 201)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 43)
__TwigTemplate_76a9d0c7eafb622905b6dee254864aea6f4dd9a7cc8ca83f33af736e0b40d8ae->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('core/themes/seven/templates/node-edit-form.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('node_edit_form', Array) (Line: 422)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 201)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 241)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 564)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 242)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 132)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 164)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 57)
Drupal\advban\AdvbanMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\ban\BanMiddleware->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 709)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

I am using Drupal core version 9.4.6.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mvnovick created an issue. See original summary.

swentel’s picture

Status: Active » Postponed (maintainer needs more info)

Hmm, could check which version of paragraphs you're running, it should be at least 8.x-1.12.

Or if another module calls 'field_group_form_pre_render', then that module should be updated.

mvnovick’s picture

I am running the latest version of the Paragraphs module, which is currently 8.x-1.15. How can I find out which other module calls 'field_group_form_pre_render'?

swentel’s picture

Hi, to find out if that function is called, you should search the codebase to look for this string: 'field_group_form_pre_render'.

Every editor normally has a search function that can search in all files.

smustgrave’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

This was marked as a top priority for a D10 release.

On Drupal core 9.4.8
Paragraphs 8.x-1.15
Field Group 8.x-3.3

Setup multiple groups inside my paragraph bundles.
Placed those bundles on a content type
Cannot trigger the error.

Closing as cannot reproduce
If still experiencing the issue please provide steps to reproduce (fields used, group settings, etc)

Thanks!

sandeep date’s picture

issue is resolved for me by applying patch as below, I am trying to access user profile with custom user display with field group functionality in which some fields are disable, so appeared issue...

sandeep date’s picture

StatusFileSize
new857 bytes
swentel’s picture

Priority: Critical » Normal
Status: Closed (cannot reproduce) » Postponed (maintainer needs more info)

@mvnovick : I completely got confused with another issue, the paragraph question was completely wrong, sorry about that :/

custom user display with field group functionality in which some fields are disable

@Sandeep Date: do you programmatically disable them, or through the UI? If so, that patch probably can't hurt, I guess.

swentel credited Sutharsan.

swentel’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new2.16 KB

  • swentel committed a385c19 on 8.x-3.x
    Issue #3311006 by Sandeep Date, swentel, Yasser Samman, robertoperuzzo,...
swentel’s picture

Status: Needs review » Fixed
swentel’s picture

Status: Fixed » Closed (fixed)
swentel’s picture

Status: Closed (fixed) » Needs review
StatusFileSize
new2.16 KB

Hmm, double checking if the revert turns it green (or whether there are some testbot problems)

swentel’s picture

Status: Needs review » Fixed

probably temporarily testbot thing (crossing fingers)

swentel’s picture

Status: Fixed » Closed (fixed)