hook_entity_reference_selection_alter() is undocumented

Created on 10 June 2024, 6 months ago
Updated 20 September 2024, 3 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

Needs work

Version

11.0 🔥

Component
Documentation 

Last updated 1 day 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
    6 months ago
    Total: 186s
    #196908
  • Issue was unassigned.
  • Status changed to Needs review 6 months ago
  • Pipeline finished with Success
    6 months ago
    Total: 621s
    #197000
  • Status changed to Needs work 6 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
    6 months ago
    #197954
  • Pipeline finished with Failed
    6 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
    3 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.

Production build 0.71.5 2024