Error on field config form

Created on 27 March 2025, 14 days ago

Problem/Motivation

Im getting an error on the field config edit form for an entity reference field, I cannot select a reference type/method because the ajax breaks.

This is whats in the js console.

ResponseText: The website encountered an unexpected error. Try again later.TypeError: Unsupported operand types: null + array in Drupal\tagify\Plugin\Field\FieldWidget\TagifyEntityReferenceAutocompleteWidget->formElement() (line 260 of modules/contrib/tagify/src/Plugin/Field/FieldWidget/TagifyEntityReferenceAutocompleteWidget.php). Drupal\Core\Field\WidgetBase->formSingleElement(Object, 0, Array, Array, Object) (Line: 101)
Drupal\Core\Field\WidgetBase->form(Object, Array, Object) (Line: 287)
Drupal\Core\Field\FieldItemList->defaultValuesForm(Array, Object) (Line: 230)
Drupal\field_ui\Form\FieldConfigEditForm->form(Array, Object) (Line: 107)
Drupal\Core\Entity\EntityForm->buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 536)
Drupal\Core\Form\FormBuilder->retrieveForm('field_config_edit_form', Object) (Line: 375)
Drupal\Core\Form\FormBuilder->rebuildForm('field_config_edit_form', Object, Array) (Line: 633)
Drupal\Core\Form\FormBuilder->processForm('field_config_edit_form', Array, Object) (Line: 326)

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ› Bug report
Status

Active

Version

1.2

Component

Code

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States loze Los Angeles

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

Comments & Activities

  • Issue created by @loze
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States loze Los Angeles

    If i go tot he form display settings and change the field to the standard autocomplete widget, then go back to the field config form it works. But its broken when the display form is set to tagify.

  • ๐Ÿ‡ช๐Ÿ‡ธSpain gxleano Cรกceres

    Hi @loze!

    First of all, thank you very much to report the issue.

    I've been trying to reproduce on my side (clean installation), but I was not able to do it. Maybe there is something in your end which is making it fail.

    Checking the attached error which you are reporting, seems like something is wrong with the handler_settings in the field where you are trying to use Tagify widget.

    We could add a validation there in order to avoid NULL handler_settings, but it is quite strange, so I will need more information from your side:

    Which version of Drupal are you using?
    Which version of the module?
    Are you using a custom handler in the field where you are trying to set Tagify as default widget?

  • ๐Ÿ‡ช๐Ÿ‡ธSpain gxleano Cรกceres
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States loze Los Angeles

    I believe what was happening was my form display settings was set to tagify in my exported yml file. Then when doing a drush cim during an import it somehow changed the hander and I was no longer able to select one. Changing it back to a standard field type then setting the handler fixed it for me, I will keep an eye on it and let you know if the problem pops back up again, but i think the issue was in my yml file.

Production build 0.71.5 2024