Tagify form elements process functions override the #attached property
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3558997. -->
Reported by: [plopesc](https://www.drupal.org/user/282415)
Related to !186 !185 !183
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>Both entity_autocomplete_tagify and select_tagify form elements overrides the '#attached' property from the form element defined by the original form render array.</p>
<p>This leads to unexpected missing libraries and breaks integration with 3rd party modules like dependent_fields.</p>
<h4 id="summary-steps-reproduce">Steps to reproduce</h4>
<p>Create a form element like: </p>
<pre>[<br> '#type' => 'select_tagify',<br>....<br> '#attached' => [<br> 'library' => [<br> 'my_module/my_library',<br> ]<br> ]<br>]</pre><p>After processSelectTagify, the ouput is:</p>
<pre>[<br> '#type' => 'select_tagify',<br>....<br> '#attached' => [<br> 'library' => [<br> 'my_module/my_library',<br> 'tagify/tagify',<br> 'tagify/default',<br> 'tagify/tagify_polyfils',<br> ]<br> ]<br>]</pre><p>And it should be:</p>
<pre>[<br> '#type' => 'select_tagify',<br>....<br> '#attached' => [<br> 'library' => [<br> 'tagify/tagify',<br> 'tagify/default',<br> 'tagify/tagify_polyfils',<br> ]<br> ]<br>]</pre><h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>Merge the attached arrays instead of override them.</p>
<h3 id="summary-remaining-tasks">Remaining tasks</h3>
<h3 id="summary-ui-changes">User interface changes</h3>
<h3 id="summary-api-changes">API changes</h3>
<h3 id="summary-data-model-changes">Data model changes</h3>
issue