Changing Country in an Address form triggers an AJAX request to update State/Province options, but the request fails with HTTP 500.

Expected:
Selecting a country should refresh State/Province options and allow continuing the form.

Actual:
AJAX fails (or hangs on “Processing…”), and the form cannot continue normally.

Error seen in logs:
TypeError: Drupal\address\Plugin\Field\FieldWidget\AddressDefaultWidget::errorElement(): Argument #1 ($element) must be of type array, null given, called in /core/lib/Drupal/Core/Field/WidgetBase.php on line 580.

Environment:

  • Drupal core 10.6.2
  • Address module 2.0.4
  • Profile module 1.14.0
  • Commerce module 3.3.5
  • PHP 8.3
  • DDEV local environment

Steps to reproduce:

  • Open a form that uses the Address widget with Country + State/Province fields.
  • Select a different country (example: United States to Canada).
  • Wait for AJAX to refresh State/Province.
  • Observe AJAX 500 error / stuck processing state.

Additional notes:
This appears to happen during AJAX rebuild/validation of the Address widget when handling validation errors and mapping the error element.

Issue fork address-3590661

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

jcontreras created an issue. See original summary.

jcontreras’s picture

Status: Active » Needs review