I'm using Mercury Editor 2.1.1 on Drupal 10.3.1 and we have Gin 3.0-RC13 installed. Gin has a gin_form_after_build()
that is unsetting $form['actions']. This results in the save button disappearing due to /mercury_editor/source/js/edit-screen.js line 100 document.querySelector('#me-save-btn').remove();
. The previous query for data-drupal-selector="edit-submit" isn't found due to that gin_form_after_build unsetting the form actions.
The first indication of an issue was https://www.drupal.org/project/gin/issues/3459995 π null is not an object (evaluating 'newParent.querySelectorAll') Fixed where Gin made an update; however, the issue became more compounded after additional testing revealed we are not able to save.
There is a corresponding issue with Gutenberg that looks like it proposes a solution but I wanted to bring attention to it here.
Gutenberg is adding some attributes to the form and then in Gin they are adding an if statement to not unset the form actions if Gutenberg is installed. https://www.drupal.org/project/gin/issues/3460150 π Save button missing when using the Gutenberg/Mercury editor module Fixed
I'm proposing that Gin also modify not to unset the form actions if
!isset($form['#gutenberg_enabled']) && !str_contains($form['#form_id'], 'mercury_editor')
.
I'm hopeful that this is a relatively easy fix but wanted to loop Mercury Editors into this if they are also using Gin.
At this time nothing to be done for Mercury Editor unless there is something I am missing.
Individuals with this issue can try MR460 from the Gin/Gutenberg issue to see the fix and I'm proposing the update from above for Gin to review.
Fixed
2.1
Code