Deprecate the type property of actions

Created on 8 May 2024, 8 months ago
Updated 13 May 2024, 7 months ago

Problem/Motivation

The type property of action config entities is a 1-to-1 copy of the type key in the respective action plugin's plugin definition. There is no value in having it be part of the configuration as it is not, in fact, configurable. Even in the (now contrib) UI it is not configurable.

Steps to reproduce

-

Proposed resolution

Deprecate the type property of action config entities.

Remaining tasks

User interface changes

None.

API changes

Action::getType() is deprecated.

Data model changes

The system.action.*:type config property is deprecated.

Release notes snippet

πŸ“Œ Task
Status

Active

Version

11.0 πŸ”₯

Component
BaseΒ  β†’

Last updated 1 day ago

Created by

πŸ‡©πŸ‡ͺGermany tstoeckler Essen, Germany

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

Comments & Activities

  • Issue created by @tstoeckler
  • πŸ‡©πŸ‡ͺGermany tstoeckler Essen, Germany

    Was in the process of creating a merge request for this, but now repurposing this instead (without a merge reuqest for now). I had thought that the type of action configuration entities is in fact configurable in some way. For example, that the entity:publish_action plugin ID is used regardless of the entity type and the entity type is determined by the type set in the action configuration. That's not actually the case, however. Instead, there is a plugin deriver that derives plugin definitions for all applicable entity types so that the actual plugin ID being used is, for example, entity:publish_action:media. The type is then just copied over from that plugin definition's type property. This is also reflected in how the (now contrib) UI does things.

    And all those entity-type-specific, derived plugin definitions the config dependencies already end up being set up correctly, because the (derived) plugins add their entity type provider as a dependency and that then gets picked up by the action entity due to the use of a plugin collection.

    So there really is no bug here unless we explicitly want to support setting an entity type ID as an action type for an action that does not extend EntityActionBase. Instead, the question is why store the type at all, if it's just a "denormalized" version of the plugin's definition's type.

    The only usage I could find in core is in views_views_data() where Views decides whether or not to add a $entity_type . '_bulk_form' views field to an entity type depending on whether there are any actions for that entity type. But that check could easily be changed to check the action plugin's definition instead.

    So I propose deprecating the type configuration property of actions.

    Re-titling and updating the issue summary, accordingly.

  • πŸ‡©πŸ‡ͺGermany tstoeckler Essen, Germany
Production build 0.71.5 2024