Menu link translations can not be created
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3479404. --> Reported by: [cmd87](https://www.drupal.org/user/3474633) Related to !29 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>In case when menu_link_attributes providing the class attribute it's not possible to save menu link translation.</p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <p>1. Ensure that you have class attribute added to the configuratrion at /admin/config/menu_link_attributes/config<br> 2. Create a menu link in English language, you can keep the cvalue for class attribute empty<br> 3. Click on add a translation and try to save it, without any changes<br> 4. You should be able to see the error: "Non-translatable fields can only be changed when updating the original language."</p> <p>After deeper investigation I found that <code>NestedArray::mergeDeep</code> producing multiple array keys when saving translation and as a result EntityUntranslatableFieldsConstraintValidator throws validation error.</p> <pre>$existing_options = {array[1]} <br> attributes = {array[1]} <br>&nbsp; class = {array[1]} <br>&nbsp;&nbsp; 0 = ""</pre><pre>$menu_link_options = {array[1]} <br> attributes = {array[3]} <br>&nbsp; class = {array[1]} <br>&nbsp;&nbsp; 0 = ""<br>&nbsp; data-separator = {int} 0<br>&nbsp; display-shop = {int} 0</pre><pre>NestedArray::mergeDeep($existing_options, $menu_link_options)<br><br>attributes = {array[3]} <br> class = {array[2]} <br>&nbsp; 0 = ""<br>&nbsp; 1 = ""<br> data-separator = {int} 0<br> display-shop = {int} 0</pre><h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Replace <code>NestedArray::mergeDeep($existing_options, $menu_link_options)</code> with <code>NestedArray::mergeDeepArray([$existing_options, $menu_link_options], TRUE)</code> to preserve integer keys instead of appending them. </p>
issue