The ContentModerationConfigureForm is missing an explicit library dependency on core/drupal.dialog.ajax

Created on 18 May 2018, over 7 years ago
Updated 15 August 2025, 10 days ago

Problem/Motivation

The ContentModerationConfigureForm currently uses ajax to launch a modal window for selecting the kind of entity types and bundles that should be moderated. This can be found at the bottom of \Drupal\content_moderation\Form\ContentModerationConfigureForm::buildConfigurationForm with a link that adds the "use-ajax" class.

The link targets a form that only works when launched in an ajax modal window, but there is no dependency on core/drupal.ajax.

Steps to reproduce:

  1. Install Drupal using the "minimal" install profile.
  2. Enable content moderation.
  3. Navigate to /admin/config/workflow/workflows/manage/editorial
  4. In the "This workflow applies to:" section, click "Select".
  5. No modal window will be launched.

Proposed resolution

Make sure we indicate that the core/drupal.ajax library should be attached to the link by adding '#attached' => ['library' => ['core/drupal.ajax']], to the link render array.

Remaining tasks

Patch and review.

User interface changes

A fixed modal window when some other component doesn't add AJAX the admin interface.

API changes

None.

Data model changes

None.

📌 Task
Status

Needs work

Version

11.0 🔥

Component

content_moderation.module

Created by

🇦🇺Australia Sam152

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇦🇺Australia acbramley

    This is no longer reproducible on HEAD because EntityForm::actions adds core/drupal.dialog.ajax to the delete link (as that opens in a modal). I guess it's probably a good idea to explicitly add this to ContentModerationConfigureForm but test coverage is going to be tricky.

    Changing this to a Task since nothing is broken anymore

Production build 0.71.5 2024