Problem/Motivation

When the Navigation module (Drupal core) is enabled alongside Gin admin theme, submitting a node edit form becomes impossible after using the Acquia DAM media embed dialog.

Steps to reproduce

  • Login to site
  • Click on Add Content → Article → Enter title and click on Media button
  • Select DAM media → Images → Select any image and click on Insert Selected
  • Once image/media appears on editor box, click on Save button
  • Expected: Article saves successfully
  • Actual: Save button is unresponsive, no action occurs

Proposed resolution

Implement hook_gin_ignore_sticky_form_actions() in acquia_dam.module to prevent Gin from applying sticky action button processing to Acquia DAM forms loaded via AJAX inside dialogs.
Gin provides this hook specifically for cases where a dynamically-loaded form incorrectly receives sticky action processing. The hook is documented in Gin's GinContentFormHelper::stickyActionButtons() at gin/src/GinContentFormHelper.php:347-349:

$form_ids = $this->moduleHandler->invokeAll('gin_ignore_sticky_form_actions');
$this->moduleHandler->alter('gin_ignore_sticky_form_actions', $form_ids);
$this->themeManager->alter('gin_ignore_sticky_form_actions', $form_ids);

When a form ID matches, Gin sets $sticky_action_buttons = FALSE, preventing the gin--has-sticky-form-actions class from being added to the form. This stops more_actions.js from processing the form's buttons and corrupting the parent form's sticky bar.
New hook implementation:

/**
 * Implements hook_gin_ignore_sticky_form_actions().
 *
 * Prevents Gin's sticky action buttons from being applied to Acquia DAM
 * forms that are loaded via AJAX inside dialogs. These forms bypass Gin's
 * built-in isModalOrOffcanvas() guard because they use dialogType: 'ajax'.
 *
 * @see \Drupal\gin\GinContentFormHelper::stickyActionButtons()
 */
function acquia_dam_gin_ignore_sticky_form_actions(): array {
  return [
    'acquia_dam_embed_select_form',
    'editor_media_revision_dialog',
    'field_media_revision_dialog',
  ];
}

The first form ID (acquia_dam_embed_select_form) is the primary fix — it's the embed form loaded inside the Media Library dialog via dialogType: 'ajax'. The other two form IDs are included defensively; they already use proper dialogType: 'modal' but benefit from the guard regardless.

Issue fork acquia_dam-3603963

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

rajeshreeputra created an issue. See original summary.

rohan-sinha’s picture

Status: Active » Reviewed & tested by the community

lgtm

  • rajeshreeputra committed 13bcca90 on 1.1.x
    Resolve #3603963 "Add hook_gin_ignore_sticky_form_actions to prevent Gin...
rajeshreeputra’s picture

Status: Reviewed & tested by the community » Fixed

MR Merged!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.