Standardize "plugin ID" in doc comments instead of "plugin_id"

Created on 25 September 2019, about 5 years ago
Updated 5 September 2024, about 2 months ago

Problem/Motivation

In core there are hundreds of usages of "The plugin_id for the plugin instance." and there are 29 usages of "The plugin ID for the plugin instance."

I think the second is nicer. The first one is redundant. Can we update this comment to be consistently the second one?

Steps to reproduce

Proposed resolution

Convert "The plugin_id for the plugin instance" to "The plugin ID for the plugin instance".

Use commands of the form:
grep -r "The plugin_id for the plugin instance" core | awk -F: '{print $1}' | xargs sed -i 's/The plugin_id for the plugin instance/The plugin ID for the plugin instance/'

and then this to find other instances of 'plugin_id' in comments
grep -r "\bplugin\_id" core | grep "\*" | grep -v "\$plugin_id" | grep -v 'plugin_id:'

Remaining tasks

Review

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

RTBC

Version

11.0 πŸ”₯

Component
PluginΒ  β†’

Last updated 7 days ago

Created by

πŸ‡ΊπŸ‡ΈUnited States oknate Greater New York City Area

Live updates comments and jobs are added and updated live.
  • Documentation

    Primarily changes documentation, not code. For Drupal core issues, select the Documentation component instead of using this tag. In general, component selection is preferred over tag selection.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

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

  • First commit to issue fork.
  • Status changed to Needs review 2 months ago
  • πŸ‡³πŸ‡ΏNew Zealand quietone

    This seems to be forgotten. I started fresh using my own commands and the grep from #28. See the proposed resolution for the commands.

  • Status changed to RTBC about 2 months ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave
    lib/Drupal/Core/Config/Schema/Mapping.php:   * - Views filters have a type of 'views.filter.[plugin_id]'; `[plugin_id]` is
    lib/Drupal/Core/Config/Schema/Mapping.php:   *   replaced by the value of the mapping's `plugin_id` key.
    lib/Drupal/Core/Render/theme.api.php: *       'plugin_id' => NULL,
    lib/Drupal/Core/Render/theme.api.php: *     'plugin_id' => NULL,
    modules/file/tests/src/Kernel/Migrate/d7/FileMigrationSetupTrait.php:   *   Array with keys 'path', 'size', 'base_path', and 'plugin_id'.
    modules/navigation/templates/block--navigation.html.twig: * - plugin_id: The ID of the navigation_block implementation.
    modules/search/templates/search-result.html.twig: * - item_list__search_results__(plugin_id)
    modules/search/templates/search-result.html.twig: * - plugin_id: The machine-readable name of the plugin being executed,such
    modules/search/search.pages.inc: *   - plugin_id: Plugin the search results came from.
    modules/system/templates/block--system-menu-block.html.twig: * - plugin_id: The ID of the block implementation.
    modules/views/tests/src/Kernel/Entity/ViewValidationTest.php:   *   ["display_options", "header", "non_existent", "plugin_id"]
    modules/views/tests/src/Kernel/Entity/ViewValidationTest.php:   *   ["display_options", "footer", "non_existent", "plugin_id"]
    modules/views/tests/src/Kernel/Entity/ViewValidationTest.php:   *   ["display_options", "empty", "non_existent", "plugin_id"]
    modules/views/tests/src/Kernel/Entity/ViewValidationTest.php:   *   ["display_options", "arguments", "non_existent", "plugin_id"]
    modules/views/tests/src/Kernel/Entity/ViewValidationTest.php:   *   ["display_options", "sorts", "non_existent", "plugin_id"]
    modules/views/tests/src/Kernel/Entity/ViewValidationTest.php:   *   ["display_options", "fields", "non_existent", "plugin_id"]
    modules/views/tests/src/Kernel/Entity/ViewValidationTest.php:   *   ["display_options", "filters", "non_existent", "plugin_id"]
    modules/views/tests/src/Kernel/Entity/ViewValidationTest.php:   *   ["display_options", "relationships", "non_existent", "plugin_id"]
    modules/rest/src/Entity/RestResourceConfig.php: *     "plugin_id",
    modules/block/block.module: *     Properties used: #block, #configuration, #children, #plugin_id.
    modules/block/templates/block.html.twig: * - plugin_id: The ID of the block implementation.
    profiles/demo_umami/themes/umami/templates/classy/content/search-result.html.twig: * - item_list__search_results__(plugin_id)
    profiles/demo_umami/themes/umami/templates/classy/content/search-result.html.twig: * - plugin_id: The machine-readable name of the plugin being executed,such
    profiles/demo_umami/themes/umami/templates/classy/block/block.html.twig: * - plugin_id: The ID of the block implementation.
    profiles/demo_umami/themes/umami/templates/classy/block/block--system-menu-block.html.twig: * - plugin_id: The ID of the block implementation.
    profiles/demo_umami/themes/umami/templates/components/footer-promo-block/block--bundle--footer-promo-block.html.twig: * - plugin_id: The ID of the block implementation.
    profiles/demo_umami/themes/umami/templates/components/banner-block/block--bundle--banner-block.html.twig: * - plugin_id: The ID of the block implementation.
    profiles/demo_umami/themes/umami/templates/components/search/block--search-form-block.html.twig: * - plugin_id: The ID of the block implementation.
    profiles/demo_umami/themes/umami/templates/components/help-block/block--help.html.twig: * - plugin_id: The ID of the block implementation.
    themes/stable9/templates/content/search-result.html.twig: * - item_list__search_results__(plugin_id)
    themes/stable9/templates/content/search-result.html.twig: * - plugin_id: The machine-readable name of the plugin being executed,such
    themes/stable9/templates/block/block.html.twig: * - plugin_id: The ID of the block implementation.
    themes/stable9/templates/block/block--system-menu-block.html.twig: * - plugin_id: The ID of the block implementation.
    themes/claro/templates/classy/content/search-result.html.twig: * - item_list__search_results__(plugin_id)
    themes/claro/templates/classy/content/search-result.html.twig: * - plugin_id: The machine-readable name of the plugin being executed,such
    themes/claro/templates/classy/block/block--search-form-block.html.twig: * - plugin_id: The ID of the block implementation.
    themes/claro/templates/classy/block/block.html.twig: * - plugin_id: The ID of the block implementation.
    themes/claro/templates/classy/block/block--system-menu-block.html.twig: * - plugin_id: The ID of the block implementation.
    themes/starterkit_theme/templates/content/search-result.html.twig: * - item_list__search_results__(plugin_id)
    themes/starterkit_theme/templates/content/search-result.html.twig: * - plugin_id: The machine-readable name of the plugin being executed,such
    themes/starterkit_theme/templates/block/block--search-form-block.html.twig: * - plugin_id: The ID of the block implementation.
    themes/starterkit_theme/templates/block/block.html.twig: * - plugin_id: The ID of the block implementation.
    themes/starterkit_theme/templates/block/block--system-menu-block.html.twig: * - plugin_id: The ID of the block implementation.
    themes/olivero/templates/content/search-result.html.twig: * - item_list__search_results__(plugin_id)
    themes/olivero/templates/content/search-result.html.twig: * - plugin_id: The machine-readable name of the plugin being executed,such
    themes/olivero/templates/block/block.html.twig: * - plugin_id: The ID of the block implementation.
    themes/olivero/templates/block/block--page-title-block.html.twig: * - plugin_id: The ID of the block implementation.
    themes/olivero/templates/block/block--primary-menu--plugin-id--search-form-block.html.twig: * - plugin_id: The ID of the block implementation.
    themes/olivero/templates/block/block--secondary-menu.html.twig: * - plugin_id: The ID of the block implementation.
    themes/olivero/templates/block/block--system-menu-block.html.twig: * - plugin_id: The ID of the block implementation.
    

    Ran the grep from #28 and got this result. Looking at the results believe they are referring to the actual key plugin_id so would be valid

    Also used phpstorm find searching comments for "plugin_id" and didn't find anything either.

  • πŸ‡¬πŸ‡§United Kingdom longwave UK

    There are still a couple of stragglers across the earlier branches but I think it's better to land this and move on than continue to perfect it forever.

    Backported down to 10.3.x to keep things in sync where possible.

    Committed and pushed 4e9a602833e to 11.x and d6a91bd890a to 11.0.x and b8b2e6f03b7 to 10.4.x and 0cb525c6fd7 to 10.3.x. Thanks!

    • longwave β†’ committed 0cb525c6 on 10.3.x
      Issue #3083507 by oknate, jungle, quietone, neelam_wadhwani, longwave,...
    • longwave β†’ committed b8b2e6f0 on 10.4.x
      Issue #3083507 by oknate, jungle, quietone, neelam_wadhwani, longwave,...
    • longwave β†’ committed d6a91bd8 on 11.0.x
      Issue #3083507 by oknate, jungle, quietone, neelam_wadhwani, longwave,...
    • longwave β†’ committed 4e9a6028 on 11.x
      Issue #3083507 by oknate, jungle, quietone, neelam_wadhwani, longwave,...
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024