Warning: Undefined array key "#disabled" in Drupal\address\Element\Country::processCountry() (line 100 of src/Element/Country.php).

Created on 15 January 2025, 4 months ago

Problem/Motivation

With PHP 8.4, I get the following warning:

Warning: Undefined array key "#disabled" in Drupal\address\Element\Country::processCountry() (line 100 of src/Element/Country.php).
Drupal\address\Element\Country::processCountry()
call_user_func_array() (Line: 1005)
Drupal\Core\Form\FormBuilder->doBuildForm() (Line: 1068)
Drupal\Core\Form\FormBuilder->doBuildForm() (Line: 1068)
Drupal\Core\Form\FormBuilder->doBuildForm() (Line: 1068)
Drupal\Core\Form\FormBuilder->doBuildForm() (Line: 1068)
Drupal\Core\Form\FormBuilder->doBuildForm() (Line: 1068)
Drupal\Core\Form\FormBuilder->doBuildForm() (Line: 571)
Drupal\Core\Form\FormBuilder->processForm() (Line: 321)
Drupal\Core\Form\FormBuilder->buildForm() (Line: 73)
Drupal\Core\Controller\FormController->getContentResult() (Line: 39)
Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController->getContentResult()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->{closure:Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber::wrapControllerExecutionInRenderContext():121}() (Line: 593)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->{closure:Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber::onController():96}() (Line: 183)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 116)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 90)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 709)
Drupal\Core\DrupalKernel->handle() (Line: 19)

Steps to reproduce

I have the address form on a Drupal 11.1 site using PHP 8.4

Proposed resolution

I imagine adding a check to ensure that the key is defined would be sufficient?

Remaining tasks

  1. Write Patch

User interface changes

N/A

API changes

N/A

Data model changes

N/A

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇺🇸United States davidwbarratt

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024