Problem/Motivation

Ajax errors when trying to add a field.

UnhandledMatchError: Unhandled match case NULL in Drupal\field_ui\Form\EntityDisplayFormBase->multistepAjax() (line 700 of /var/www/html/web/core/modules/field_ui/src/Form/EntityDisplayFormBase.php)

#0 /var/www/html/web/modules/contrib/custom_elements/modules/custom_elements_ui/src/Form/EntityCustomElementsDisplayEditForm.php(808): Drupal\field_ui\Form\EntityDisplayFormBase->multistepAjax()
#1 [internal function]: Drupal\custom_elements_ui\Form\EntityCustomElementsDisplayEditForm->multistepAjax()
#2 /var/www/html/web/core/lib/Drupal/Core/Form/FormAjaxResponseBuilder.php(69): call_user_func_array()
#3 /var/www/html/web/core/lib/Drupal/Core/Form/EventSubscriber/FormAjaxSubscriber.php(112): Drupal\Core\Form\FormAjaxResponseBuilder->buildResponse()
#4 /var/www/html/vendor/symfony/event-dispatcher/EventDispatcher.php(246): Drupal\Core\Form\EventSubscriber\FormAjaxSubscriber->onException()
...
#23 {main}

Steps to reproduce

Drupal version above ^10.3.5 || ^11 and custom elements ^3.0.0. Visit custom elements display page and try to add a field.

Tested on Drupal 10.2.8 and it works fine.

Remaining tasks

Needs investigation.

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

useernamee created an issue. See original summary.

useernamee’s picture

Issue summary: View changes
roderik’s picture

Well... that's dumb! I was still developing on D10.2, and the "add field" button is broken on D10.3+.

Also, we don't have browser tests for the UI yet. We should, but realistically... that's not on the radar yet.

(A switch() was replaced by map() in EntityDisplayFormBase::multistepAjax(), which apparently means it cannot handle unknown values == any buttons that the Core code doesn't know about, anymore. Fine; I won't call parent::multistepAjax().)

roderik’s picture

Status: Active » Needs review

Creating MR, but I might merge this myself. Unless someone prods me, that may wait until Monday morning, while I try to get some other fixes in a 3.0.1 release.

useernamee’s picture

Status: Needs review » Reviewed & tested by the community

Tested on 10.3.5. Works fine thus merging.

The error is gone from the watchdog.

  • useernamee committed 427aba8f on 3.x authored by roderik
    Issue #3478276 by roderik, useernamee: Can not add fields to custom...
useernamee’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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