Problem/Motivation

I am finding this error in alpha6 - I am using Drupal 10.5.3

TypeError: Drupal\Component\Utility\NestedArray::getValue(): Argument #2 ($parents) must be of type array, null given, called in D:\wwwroot\pss-2024-fix\web\modules\contrib\conditional_fields\src\ConditionalFieldsFormHelper.php on line 905 in Drupal\Component\Utility\NestedArray::getValue() (line 69 of D:\wwwroot\pss-2024-fix\web\core\lib\Drupal\Component\Utility\NestedArray.php).

#0 D:\wwwroot\pss-2024-fix\web\modules\contrib\conditional_fields\src\ConditionalFieldsFormHelper.php(905): Drupal\Component\Utility\NestedArray::getValue(Array, NULL)
#1 D:\wwwroot\pss-2024-fix\web\modules\contrib\conditional_fields\src\ConditionalFieldsFormHelper.php(830): Drupal\conditional_fields\ConditionalFieldsFormHelper::formFieldGetValues(NULL, Object(Drupal\Core\Form\FormState))
#2 [internal function]: Drupal\conditional_fields\ConditionalFieldsFormHelper::formValidate(Array, Object(Drupal\Core\Form\FormState))
#3 D:\wwwroot\pss-2024-fix\web\core\lib\Drupal\Core\Form\FormValidator.php(82): call_user_func_array(Array, Array)
#4 D:\wwwroot\pss-2024-fix\web\core\lib\Drupal\Core\Form\FormValidator.php(274): Drupal\Core\Form\FormValidator->executeValidateHandlers(Array, Object(Drupal\Core\Form\FormState))
#5 D:\wwwroot\pss-2024-fix\web\core\lib\Drupal\Core\Form\FormValidator.php(118): Drupal\Core\Form\FormValidator->doValidateForm(Array, Object(Drupal\Core\Form\FormState), 'node_certificat...')
#6 D:\wwwroot\pss-2024-fix\web\core\lib\Drupal\Core\Form\FormBuilder.php(593): Drupal\Core\Form\FormValidator->validateForm('node_certificat...', Array, Object(Drupal\Core\Form\FormState))
#7 D:\wwwroot\pss-2024-fix\web\core\lib\Drupal\Core\Form\FormBuilder.php(326): Drupal\Core\Form\FormBuilder->processForm('node_certificat...', Array, Object(Drupal\Core\Form\FormState))
#8 D:\wwwroot\pss-2024-fix\web\core\lib\Drupal\Core\Controller\FormController.php(73): Drupal\Core\Form\FormBuilder->buildForm(Object(Drupal\node\NodeForm), Object(Drupal\Core\Form\FormState))
#9 D:\wwwroot\pss-2024-fix\web\core\modules\layout_builder\src\Controller\LayoutBuilderHtmlEntityFormController.php(39): Drupal\Core\Controller\FormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch))
#10 [internal function]: Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch))
#11 D:\wwwroot\pss-2024-fix\web\core\lib\Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#12 D:\wwwroot\pss-2024-fix\web\core\lib\Drupal\Core\Render\Renderer.php(637): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#13 D:\wwwroot\pss-2024-fix\web\core\lib\Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#14 D:\wwwroot\pss-2024-fix\web\core\lib\Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#15 D:\wwwroot\pss-2024-fix\vendor\symfony\http-kernel\HttpKernel.php(181): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#16 D:\wwwroot\pss-2024-fix\vendor\symfony\http-kernel\HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#17 D:\wwwroot\pss-2024-fix\web\core\lib\Drupal\Core\StackMiddleware\Session.php(53): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#18 D:\wwwroot\pss-2024-fix\web\core\lib\Drupal\Core\StackMiddleware\KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#19 D:\wwwroot\pss-2024-fix\web\core\lib\Drupal\Core\StackMiddleware\ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#20 D:\wwwroot\pss-2024-fix\web\core\modules\big_pipe\src\StackMiddleware\ContentLength.php(32): Drupal\Core\StackMiddleware\ContentLength->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#21 D:\wwwroot\pss-2024-fix\web\core\modules\page_cache\src\StackMiddleware\PageCache.php(116): Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#22 D:\wwwroot\pss-2024-fix\web\core\modules\page_cache\src\StackMiddleware\PageCache.php(90): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#23 D:\wwwroot\pss-2024-fix\web\modules\contrib\advban\src\AdvbanMiddleware.php(57): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#24 D:\wwwroot\pss-2024-fix\web\core\modules\ban\src\BanMiddleware.php(50): Drupal\advban\AdvbanMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#25 D:\wwwroot\pss-2024-fix\web\core\lib\Drupal\Core\StackMiddleware\ReverseProxyMiddleware.php(48): Drupal\ban\BanMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#26 D:\wwwroot\pss-2024-fix\web\core\lib\Drupal\Core\StackMiddleware\NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#27 D:\wwwroot\pss-2024-fix\web\core\lib\Drupal\Core\StackMiddleware\AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#28 D:\wwwroot\pss-2024-fix\web\core\lib\Drupal\Core\StackMiddleware\StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#29 D:\wwwroot\pss-2024-fix\web\core\lib\Drupal\Core\DrupalKernel.php(741): Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#30 D:\wwwroot\pss-2024-fix\web\index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#31 {main}

Steps to reproduce

This is reproduced many times in my logs, trying to narrow how my applicants are triggering this, following up.

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

goose2000 created an issue. See original summary.

arx-e made their first commit to this issue’s fork.

arx-e’s picture

I had this problem too with Drupal 11.2.4 and paragraphs.
I added ?? [] in line 905 and I haven;t done many tests yet but it seems to me that it solves the issue.

arx-e’s picture

Well unfortunately it seems there are more problems coming up in lines 832, 900.

goose2000’s picture

Hi - I think I made a duplicate of my earlier bug - It was just that I was working from Drupal 10.5.3

Some work was done here (set to closed duplicate):
https://www.drupal.org/project/conditional_fields/issues/3525700

Original (still open) :
https://www.drupal.org/project/conditional_fields/issues/3501575
Was on Drupal 10.3.10 at that time.

joelpittet’s picture

Status: Active » Closed (duplicate)

#3495402: Warning: Trying to access array offset on value of type null in Drupal\conditional_fields\ConditionalFieldsFormHelper::formFieldGetValues() Thanks for reporting this, I believe it's a duplicate. LMK if you are still experiencing this in the dev release (or when the beta1 comes out and I'll take another look)

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.