Can confirm that MR 17 does also seem to address this jQuery once error referenced here: https://www.drupal.org/project/disqus/issues/3359581 π Uncaught TypeError: $(...).once is not a function Fixed
Related issue: https://www.drupal.org/project/gin/issues/3406878 β¨ Support for the Mercury Editor module Active
This happens because the published checkbox gets moves to the sticky action buttons in Gin, which isn't rendered in the Mercury Editor context. So there's no way to publish content that way.
I think the solution would indeed be for Mercury Editor to use hook_gin_ignore_sticky_form_actions_alter()
to skip moving the published checkbox to sticky action buttons (which aren't rendered) in the mercury editor context. However, there is a Gin issue where the results of that hook are ignored for content forms and cannot be disabled. I think that's a Gin issue, which would give Mercury Editor a legit way to implement a solution. Here's a related Gin issue:
https://www.drupal.org/project/gin/issues/3488050
π
Uncaught TypeError: formActions is null on a form that is trying not to use Gin form modifications
Active
At any rate, adding similar ignore form id alter hooks to isContentForm()
like @mlcn mentioned would certainly help. Ideally, though, the stickyActionButtons()
method would actually control sticky actions behavior (it could default to true for content forms by calling isContentForm()
itself when the setting is enabled), and the remaining alterations specific to content forms would only be controlled by isContentForm()
and its new alter hooks.
I've run into a related issue here, where you can't actually disable sticky action buttons on content forms.
The GinContentFormHelper->formAlter()
method does actually check if the current form ID should have sticky action buttons or not using GinContentFormHelper->stickyActionButtons()
βwhich invokes alter hooks so you can ignore form ids via hook_gin_ignore_sticky_form_actions_alter
. This I've done, and I can see that $sticky_action_buttons
has been set to FALSE
for the form I'm trying to skip sticky action buttons on.
However, formAlter()
immediately ignores that flag for content forms, rendering hook_gin_ignore_sticky_form_actions_alter
completely useless for content forms:
public function formAlter(array &$form, FormStateInterface $form_state, $form_id) {
//...
// Save form types and behaviors.
$use_sticky_action_buttons = $this->stickyActionButtons($form, $form_state, $form_id);
$is_content_form = $this->isContentForm($form, $form_state, $form_id);
// Sticky action buttons.
if (($use_sticky_action_buttons || $is_content_form) && isset($form['actions'])) {
// Add sticky action button behavior...
This seems like an oversight in the logic, since you can never disable sticky action buttons on content forms this way, in effect, ignoring gin_ignore_sticky_form_actions
.
Works great.
Works like a charm, thank you @aporie !
Worked well for me, too.