AJAX is broken on the add condition form

Created on 1 September 2021, almost 3 years ago
Updated 10 October 2023, 9 months ago

Problem/Motivation

It is impossible to use AJAX on the condition configuration form due to the way the add condition form is rendered by ManageConditions::add(). The form is rendered on a route where it doesn't exist and then displayed in a modal. It's also the reason why the form action has to be overwritten by the same method.

Steps to reproduce

  • Install Entity Field Condition module from this MR or any other condition plugin with AJAX.
  • Try to add this type of condition to any list.
  • Trigger AJAX on the condition form. It does nothing.

Proposed resolution

In order for AJAX to work, the module has to make a sub-request to the form route. This way the form is rendered on a route where it exists and AJAX requests work as expected.

Remaining tasks

No.

User interface changes

No.

API changes

  • \Drupal\ctools\Form\ManageConditions::getConditionClass() is deleted, as it's not necessary anymore.

Data model changes

No.

πŸ› Bug report
Status

Needs review

Version

3.0

Component

Code

Created by

πŸ‡²πŸ‡ͺMontenegro Dmitriy.trt

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.

Production build 0.69.0 2024