Move all action buttons into gin_actions / module incompatibility
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3219020. --> Reported by: [anybody](https://www.drupal.org/user/291091) >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>Gin moves the "Save" Button into an own field group in gin.theme:</p> <div class="codeblock"> <pre><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br></span><span style="color: #007700">function </span><span style="color: #0000BB">gin_form_alter</span><span style="color: #007700">(&amp;</span><span style="color: #0000BB">$form</span><span style="color: #007700">, </span><span style="color: #0000BB">$form_state</span><span style="color: #007700">, </span><span style="color: #0000BB">$form_id</span><span style="color: #007700">) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [...]<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #FF8000">// Add Submit to gin_actions actions.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #0000BB">$form</span><span style="color: #007700">[</span><span style="color: #DD0000">'gin_actions'</span><span style="color: #007700">][</span><span style="color: #DD0000">'actions'</span><span style="color: #007700">][</span><span style="color: #DD0000">'submit'</span><span style="color: #007700">] = (</span><span style="color: #0000BB">$form</span><span style="color: #007700">[</span><span style="color: #DD0000">'actions'</span><span style="color: #007700">][</span><span style="color: #DD0000">'submit'</span><span style="color: #007700">]) ?? [];<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [...]<br></span><span style="color: #0000BB">?&gt;</span></span></pre></div> <p>Other modules like entity_save_and_addanother may also add further buttons to the actions. These are not copied over and end up in the right sidebar. Anyway these module's shouldn't have to know about Gin.</p> <p>I guess the better option would be to copy every button from actions to keep them consistently beside each other like they would be in any other theme. But in gin_actions. Or we need a completely different solution where everything stays in the core actions array and gin_actions just triggers them in JS or similar to not affect any other modules.</p> <p>Furthermore, the functionality from entity_save_and_addanother seems to be also broken in Gin Theme. I didn't see yet why, as Gin doesn't seem to remove it from actions. Perhaps the process hook isn't fired, I don't know.</p> <p>This is not only about entity_save_and_addanother but all modules adding custom actions to entity edit forms.</p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <p>See <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/entity_save_and_addanother/issues/3193042" title="Status: Closed (fixed)">#3193042: Does not work with Gin theme</a></span></p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Do not copy single actions "preview" and "submit" into gin_actions but the whole actions array.</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