hook_entity_reference_selection_alter() is undocumented

Created on 10 June 2024, 10 months ago

Problem/Motivation

SelectionPluginManager does:

    $this->alterInfo('entity_reference_selection');

But I can't find hook_entity_reference_selection_alter documented in any api.php file.

Steps to reproduce

Proposed resolution

Write the documentation. This should go in core/lib/Drupal/Core/Entity/entity.api.php.

Use another alter hook for a plugin type as a template, e.g. hook_views_plugins_access_alter

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Active

Version

11.0 🔥

Component
Documentation 

Last updated about 14 hours ago

No maintainer
Created by

🇬🇧United Kingdom joachim

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

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @joachim
  • Assigned to prabha1997
  • 🇮🇳India prabha1997

    I am working on this documentation

  • Pipeline finished with Failed
    10 months ago
    Total: 186s
    #196908
  • Issue was unassigned.
  • Status changed to Needs review 10 months ago
  • Pipeline finished with Success
    10 months ago
    Total: 621s
    #197000
  • Status changed to Needs work 10 months ago
  • 🇬🇧United Kingdom joachim

    There's something wrong with your MR -- it's saying 1000+ changes!

    Are you sure your branches are correct?

  • First commit to issue fork.
  • Pipeline finished with Canceled
    10 months ago
    #197954
  • Pipeline finished with Failed
    10 months ago
    Total: 543s
    #197961
  • 🇵🇹Portugal dxvargas

    I'm extremely confused with the MR that I see related with this issue. So many commits... why?

    As I understand we simply need to add something like this to lib/Drupal/Core/Entity/entity.api.php:

    /**
     * Modify the list of available entity reference plugins.
     *
     * This hook may be used to modify plugin properties after they have been
     * specified by other modules.
     *
     * @param array $plugins
     *   An array of all the existing plugin definitions, passed by reference.
     *
     * @see \Drupal\Core\Entity\EntityReferenceSelection\SelectionPluginManager
     */
    function hook_entity_reference_selection_alter(array &$plugins) {
      // Remove a plugin.
      unset($plugins['broken']);
    }
    

    What am I missing?

  • First commit to issue fork.
  • Pipeline finished with Success
    7 months ago
    #294194
  • 🇬🇧United Kingdom joachim

    > I'm extremely confused with the MR that I see related with this issue. So many commits... why?

    That can happen when the target branch set on the MR and the actual parent branch of the MR branch are not the same.

  • 🇧🇪Belgium xdequinze Brussels

    I was working on this issue with nhojivar7 at DrupalCon Barcelona contribution's day.

  • Status changed to Needs review 6 days ago
  • 🇧🇷Brazil isa.bel Balneário Camboriú

    The documentation seems complete and correct now, I will set this to Needs Review

  • 🇺🇸United States smustgrave

    Can 1 MR be closed or hidden.

    Also may want to check usage as I don't see anything in core besides a test using this hook. Maybe it's not needed?

  • 🇬🇧United Kingdom joachim

    > Also may want to check usage as I don't see anything in core besides a test using this hook. Maybe it's not needed?

    It's standard for all plugin managers to have an alter hook for the discovered plugin info.

  • 🇧🇷Brazil isa.bel Balneário Camboriú

    isa.bel changed the visibility of the branch document-hook_entity_reference_selection_alter to hidden.

  • 🇧🇷Brazil isa.bel Balneário Camboriú

    isa.bel changed the visibility of the branch document-hook_entity_reference_selection_alter to active.

  • 🇧🇷Brazil isa.bel Balneário Camboriú

    isa.bel changed the visibility of the branch 3453692-hookentityreferenceselectionalter-is-undocumented to hidden.

  • 🇧🇷Brazil isa.bel Balneário Camboriú

    MR 1 hidden, but I can't close it

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

    This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

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

Production build 0.71.5 2024