Problem/Motivation

When i enable module i get this error on taxonomy edit page:

The website encountered an unexpected error. Please try again later.
TypeError: Drupal\Core\Render\Element::children(): Argument #1 ($elements) must be of type array, null given, called in /var/www/html/web/core/modules/content_translation/src/ContentTranslationHandler.php on line 553 in Drupal\Core\Render\Element::children() (line 72 of core/lib/Drupal/Core/Render/Element.php).
Drupal\Core\Render\Element::children(NULL) (Line: 553)
Drupal\content_translation\ContentTranslationHandler->entityFormAlter(Array, Object, Object) (Line: 18)
Drupal\taxonomy\TermTranslationHandler->entityFormAlter(Array, Object, Object) (Line: 399)
content_translation_form_alter(Array, Object, 'taxonomy_term_product_category_form') (Line: 562)
Drupal\Core\Extension\ModuleHandler->alter('form', Array, Object, 'taxonomy_term_product_category_form') (Line: 835)
Drupal\Core\Form\FormBuilder->prepareForm('taxonomy_term_product_category_form', Array, Object) (Line: 279)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object) (Line: 39)
Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 169)
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: 130)
Drupal\cdn\StackMiddleware\DuplicateContentPreventionMiddleware->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: 707)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Steps to reproduce

Enable module
Enable tanslation
Go to /en/taxonomy/term//edit

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

trickfun created an issue. See original summary.

parisek’s picture

I'll get same error on older site, will debug later

parisek’s picture

Title: TypeError: Drupal\Core\Render\Element::children(): Argument #1 ($elements) must be of type array, null given » Support for Content Translation
Version: 1.0.2 » 1.0.x-dev
Status: Active » Needs review

Hi, I've had some spare time to debug this issue, basically it's about run form_alter at the latest. I'll provided fix and tested it with Content Translation module, but should help with any module which alters same form. Please review

Jeya sundhar made their first commit to this issue’s fork.

Renganathan T’s picture

Status: Needs review » Reviewed & tested by the community

Reviewed. This working fine.

sundhar’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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

sundhar’s picture