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-&gt;formElement() (line 196 of modules/contrib/tagify/src/Plugin/Field/FieldWidget/TagifySelectWidget.php).</p> <pre>Drupal\Core\Field\WidgetBase-&gt;formSingleElement(Object, 0, Array, Array, Object) (Line: 101)<br>Drupal\Core\Field\WidgetBase-&gt;form(Object, Array, Object) (Line: 197)<br>Drupal\Core\Entity\Entity\EntityFormDisplay-&gt;buildForm(Object, Array, Object) (Line: 121)<br>Drupal\Core\Entity\ContentEntityForm-&gt;form(Array, Object) (Line: 140)<br>Drupal\node\Form\NodeForm-&gt;form(Array, Object) (Line: 108)<br>Drupal\Core\Entity\EntityForm-&gt;buildForm(Array, Object)<br>call_user_func_array(Array, Array) (Line: 554)<br>Drupal\Core\Form\FormBuilder-&gt;retrieveForm('node_article_form', Object) (Line: 303)<br>Drupal\Core\Form\FormBuilder-&gt;buildForm(Object, Object) (Line: 73)<br>Drupal\Core\Controller\FormController-&gt;getContentResult(Object, Object)<br>call_user_func_array(Array, Array) (Line: 123)<br>Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;{closure:Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber::wrapControllerExecutionInRenderContext():121}() (Line: 634)<br>Drupal\Core\Render\Renderer::{closure:Drupal\Core\Render\Renderer::executeInRenderContext():634}()<br>Fiber-&gt;resume() (Line: 649)<br>Drupal\Core\Render\Renderer-&gt;executeInRenderContext(Object, Object) (Line: 121)<br>Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)<br>Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;{closure:Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber::onController():96}() (Line: 183)<br>Symfony\Component\HttpKernel\HttpKernel-&gt;handleRaw(Object, 1) (Line: 76)<br>Symfony\Component\HttpKernel\HttpKernel-&gt;handle(Object, 1, 1) (Line: 53)<br>Drupal\Core\StackMiddleware\Session-&gt;handle(Object, 1, 1) (Line: 48)<br>Drupal\Core\StackMiddleware\KernelPreHandle-&gt;handle(Object, 1, 1) (Line: 28)<br>Drupal\Core\StackMiddleware\ContentLength-&gt;handle(Object, 1, 1) (Line: 32)<br>Drupal\big_pipe\StackMiddleware\ContentLength-&gt;handle(Object, 1, 1) (Line: 118)<br>Drupal\page_cache\StackMiddleware\PageCache-&gt;pass(Object, 1, 1) (Line: 92)<br>Drupal\page_cache\StackMiddleware\PageCache-&gt;handle(Object, 1, 1) (Line: 48)<br>Drupal\Core\StackMiddleware\ReverseProxyMiddleware-&gt;handle(Object, 1, 1) (Line: 51)<br>Drupal\Core\StackMiddleware\NegotiationMiddleware-&gt;handle(Object, 1, 1) (Line: 53)<br>Drupal\Core\StackMiddleware\AjaxPageState-&gt;handle(Object, 1, 1) (Line: 54)<br>Drupal\Core\StackMiddleware\StackedHttpKernel-&gt;handle(Object, 1, 1) (Line: 745)<br>Drupal\Core\DrupalKernel-&gt;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