Use Drupal plugin system with OperationTypes

Created on 7 May 2025, 6 days ago

Problem/Motivation

For different reasons (one of them to keep the abstraction layer intact and prevent creation of provider-specific operations), in AI 1.0.x/1.1.x operation types are not the same plugins that one would expect from a Drupal module.

This was working mostly fine, especially after adding a workaround in Programmatically add OperationType Active , but the change in Drupal core 📌 Add a fallback classloader that can handle missing traits Active has broken internal logic of using interfaces instead of classes for the operation types discovery.

🐛 Not getting all operation types on AI Settings page Active overcomes this change by using custom plugin discovery, but this looks "patchy"

Proposed resolution

It was proposed multiple times to use default Drupal plugin system for the operation types, maybe it is time to do so.

Remaining tasks

* Write the patch
* Add the test that custom operation types are discoverable

User interface changes

No UI changes

API changes

Contrib modules get "native" (not via alter hook) option to define their own operation types.

📌 Task
Status

Active

Version

2.0

Component

AI Core module

Created by

🇧🇬Bulgaria valthebald Sofia

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

Comments & Activities

Production build 0.71.5 2024