Add support for custom form-element supporting entity_reference
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3411891. --> Reported by: [stmh](https://www.drupal.org/user/35538) Related to !89 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>Currently there is no easy way to use Tagify as autocomplete inside a custom form for a entity_reference form-element.</p> <p>Here's an example of how I use the existing entity_reference type:</p> <pre>$form['user_reference'] = [<br>&nbsp; '#type' =&gt; 'entity_autocomplete',<br>&nbsp; '#target_type' =&gt; 'user',<br>&nbsp; '#title' =&gt; t('User'),<br>&nbsp; '#description' =&gt; t('Enter a user name or email address.'),<br>&nbsp; '#default_value' =&gt; $current_user, // optional, a user object for pre-populating the field<br>];</pre><p>It would be great to use tagify for this problem scenario, which is currently not possible, as the Tagify settings are stored inside a key/value store and retrieved in the autocomplete-handler, which is hard to mimic w/o a fully fledged field-widget.</p> <p>Slightly related to #3352158</p> > Related issue: [Issue #3352158](https://www.drupal.org/node/3352158)
issue