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

Issue fork drupal-3453692

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

joachim created an issue. See original summary.

prabha1997’s picture

Assigned: Unassigned » prabha1997

I am working on this documentation

prabha1997’s picture

Assigned: prabha1997 » Unassigned
Status: Active » Needs review
joachim’s picture

Status: Needs review » Needs work

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

Are you sure your branches are correct?

ankitv18 made their first commit to this issue’s fork.

quietone’s picture

Version: 11.0.x-dev » 11.x-dev
dxvargas’s picture

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?

nhojivar7 made their first commit to this issue’s fork.

joachim’s picture

> 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.

xdequinze’s picture

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

isa.bel’s picture

Category: Bug report » Task
Status: Needs work » Needs review

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

smustgrave’s picture

Status: Needs review » Needs work

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?

joachim’s picture

> 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.

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

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

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

isa.bel’s picture

Status: Needs work » Needs review

MR 1 hidden, but I can't close it

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new693 bytes

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.

isa.bel’s picture

I checked the PR and all the checks passed, therefore I'm changing this to needs review again.

joachim’s picture

Status: Needs work » Reviewed & tested by the community

LGTM!

needs-review-queue-bot’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new693 bytes

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.

isa.bel’s picture

Status: Needs work » Reviewed & tested by the community

It's not possible to run phpstan in this file

needs-review-queue-bot’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new693 bytes

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.

joachim’s picture

Status: Needs work » Reviewed & tested by the community
Issue tags: +no-needs-review-bot
smustgrave’s picture

The bot may be correct, MR is 1800 commits back

smustgrave’s picture

I imagine the bot is complaining there’s no return of void

quietone’s picture

Status: Reviewed & tested by the community » Needs work

This needs one small change, see the comment in the MR.

agunjan085 made their first commit to this issue’s fork.

agunjan085’s picture

Status: Needs work » Needs review
joachim’s picture

Status: Needs review » Reviewed & tested by the community

LGTM

  • quietone committed 27629c7a on 11.x
    Issue #3453692 by nhojivar7, agunjan085, joachim, isa.bel, xdequinze:...

  • quietone committed c186e85a on 11.2.x
    Issue #3453692 by nhojivar7, agunjan085, joachim, isa.bel, xdequinze:...

quietone’s picture

Version: 11.x-dev » 11.2.x-dev
Status: Reviewed & tested by the community » Fixed

Committed to 11.2.x and 11.x

Thanks!

joachim’s picture

Thanks! As a docs-only fix, can this be committed to the 10 branch too?

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.