Add "no_ui = true" to the definition of deprecated action plugins

Created on 15 November 2019, over 4 years ago
Updated 30 January 2023, over 1 year ago

Problem/Motivation

In the Feeds module I expose action plugins in the UI and I do that in the following way:
$action_definitions = \Drupal::service('plugin.manager.action')->getDefinitionsByType($entity_type);
The issue is that also deprecated action plugins show up in the UI, without the user knowing. The action plugins only conditionally get instantiated and that happens at a totally different level (not in the admin UI).

Some of the deprecated action plugins are documented on https://www.drupal.org/node/2919303 , but in the definitions of these you cannot see that they are deprecated:

node_publish_action’ => array(6)
    ‘confirm_form_route_name’ => string(0) “”
    ‘type’ => string(4) “node”
    ‘id’ => string(19) “node_publish_action”
    →‘label’ => Drupal\Core\StringTranslation\TranslatableMarkup(5)
    ‘class’ => string(37) “Drupal\node\Plugin\Action\PublishNode”
    ‘provider’ => string(4) “node”

Related Feeds issue #3094433: Hide deprecated actions from UI (and replace them with a database update)

Proposed resolution

@andypost pointed me to the following documentation: https://www.drupal.org/core/deprecation#how-plugin

Add no_ui = true to the plugin definition. If the plugin does not support no_ui but is selectable in a UI then an issue will be needed to add it.

However I see also some discussion on #2922451: [policy no patch] Make it possible to mark plugins as deprecated that the no_ui key won't cover plugins that are extending deprecated action plugins. But I think having at least the ones in Drupal Core not showing up in the UI would already be a great win.

Remaining tasks

User interface changes

The deprecated action plugins in Drupal Core no longer show up in the UI when developers iterating over action plugins check for the no_ui key.

API changes

The action plugin definition get a new property called $no_ui.

Data model changes

None.

I'll work on a patch.

🐛 Bug report
Status

Needs work

Version

9.5

Component
Plugin 

Last updated about 18 hours ago

Created by

🇳🇱Netherlands MegaChriz

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.

  • The Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

    Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

    Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

Production build 0.69.0 2024