TypeError: Unsupported operand types: null + array in Drupal\tagify\Plugin\Field\FieldWidget\TagifySelectWidget->formElement() (line 196 of modules/contrib/tagify/src/Plugin/Field/FieldWidget/TagifySelectWidget.php).
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3567238. -->
Reported by: [nico.b](https://www.drupal.org/user/3627419)
Related to !192
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>The most recent update to 1.2.46 broke Tagify for fields of type "Selection list". When editing an entity with such a field that uses the "Tagify Select" widget, an unexpected error occurs:</p>
<p>The website encountered an unexpected error. Try again later.</p>
<p>TypeError: Unsupported operand types: null + array in Drupal\tagify\Plugin\Field\FieldWidget\TagifySelectWidget->formElement() (line 196 of modules/contrib/tagify/src/Plugin/Field/FieldWidget/TagifySelectWidget.php).</p>
<pre>Drupal\Core\Field\WidgetBase->formSingleElement(Object, 0, Array, Array, Object) (Line: 101)<br>Drupal\Core\Field\WidgetBase->form(Object, Array, Object) (Line: 197)<br>Drupal\Core\Entity\Entity\EntityFormDisplay->buildForm(Object, Array, Object) (Line: 121)<br>Drupal\Core\Entity\ContentEntityForm->form(Array, Object) (Line: 140)<br>Drupal\node\Form\NodeForm->form(Array, Object) (Line: 108)<br>Drupal\Core\Entity\EntityForm->buildForm(Array, Object)<br>call_user_func_array(Array, Array) (Line: 554)<br>Drupal\Core\Form\FormBuilder->retrieveForm('node_article_form', Object) (Line: 303)<br>Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)<br>Drupal\Core\Controller\FormController->getContentResult(Object, Object)<br>call_user_func_array(Array, Array) (Line: 123)<br>Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->{closure:Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber::wrapControllerExecutionInRenderContext():121}() (Line: 634)<br>Drupal\Core\Render\Renderer::{closure:Drupal\Core\Render\Renderer::executeInRenderContext():634}()<br>Fiber->resume() (Line: 649)<br>Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)<br>Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)<br>Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->{closure:Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber::onController():96}() (Line: 183)<br>Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)<br>Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 53)<br>Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)<br>Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)<br>Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 32)<br>Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 118)<br>Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 92)<br>Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)<br>Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)<br>Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 53)<br>Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 54)<br>Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 745)<br>Drupal\Core\DrupalKernel->handle(Object) (Line: 19)</pre><h4 id="summary-steps-reproduce">Steps to reproduce</h4>
<p>1. Set-up Drupal and install Tagify<br>
2. For a content type, create a new field of type "Selection list" and save it<br>
3. Configure the field to use the "Tagify Select" widget and save the configuration<br>
4. Try to create a new entity of the content type<br>
5. The error states above occurs when the form is rendered</p>
<h3 id="summary-remaining-tasks">Remaining tasks</h3>
<p>- Review the MR<br>
- Add test coverage (?)</p>
issue