In CommentSelection.php there is a @see tag that says:

@see SelectionEntityTypeNode::entityQueryAlter()

Drupal doesn't define any SelectionEntityTypeNode class. That comment should be fixed to refer the right class, or be removed.

That comment has been introduced in #1801304: Add Entity reference field, but I cannot understand to which class it is referring, and which class replaces it, if there is any.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kiamlaluno created an issue. See original summary.

apaderno’s picture

Issue summary: View changes

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

gaurav.kapoor’s picture

Status: Active » Needs review
FileSize
809 bytes

Checked the code below @see tag, didn't find it relevant. I guess it should be removed.

cilefen’s picture

apaderno’s picture

Given the class name (SelectionEntityTypeNode), I would take it should be the NodeSelection class, but that doesn't implement entityQueryAlter(), and its parent class has an empty method for that. Looking for an entity query class, I don't find one that is specific for the node entity.

In short, I don't find any method/function that proves what that comment says. I think it can be removed, as it is just confusing.

amateescu’s picture

\Drupal\node\Plugin\EntityReferenceSelection\NodeSelection::buildEntityQuery() is the correct method reference for that @see in D8 :)

gaurav.kapoor’s picture

Assigned: Unassigned » gaurav.kapoor
gaurav.kapoor’s picture

gaurav.kapoor’s picture

Assigned: gaurav.kapoor » Unassigned
gaurav.kapoor’s picture

gaurav.kapoor’s picture

Removing patches which are not required.

amateescu’s picture

+++ b/core/modules/comment/src/Plugin/EntityReferenceSelection/CommentSelection.php
@@ -85,7 +85,7 @@ public function entityQueryAlter(SelectInterface $query) {
+    // @see NodeSelection::buildEntityQuery()

We need to provide the full namespace of the class, just copy paste it from #7.

cilefen’s picture

Status: Needs review » Needs work
gaurav.kapoor’s picture

Did changes as per #7.

gaurav.kapoor’s picture

Status: Needs work » Needs review
amateescu’s picture

Status: Needs review » Reviewed & tested by the community

Looks good now.

  • catch committed 1c72ba5 on 8.6.x
    Issue #2935575 by gaurav.kapoor, kiamlaluno, amateescu: Fix or remove...
catch’s picture

Version: 8.6.x-dev » 8.5.x-dev
Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.6.x and cherry-picked to 8.5.x. Thanks!

  • catch committed 648d7c5 on 8.5.x
    Issue #2935575 by gaurav.kapoor, kiamlaluno, amateescu: Fix or remove...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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