X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fcomment%2Fsrc%2FPlugin%2FEntityReferenceSelection%2FCommentSelection.php;h=3c13776e1245764002a15a4e16a04e73819c9319;hb=1c1cb0980bfa6caf0c24cce671b6bb541dc87583;hp=2492fc4336baa045b83a08ae8714e96057f32d39;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;p=yaffs-website diff --git a/web/core/modules/comment/src/Plugin/EntityReferenceSelection/CommentSelection.php b/web/core/modules/comment/src/Plugin/EntityReferenceSelection/CommentSelection.php index 2492fc433..3c13776e1 100644 --- a/web/core/modules/comment/src/Plugin/EntityReferenceSelection/CommentSelection.php +++ b/web/core/modules/comment/src/Plugin/EntityReferenceSelection/CommentSelection.php @@ -42,7 +42,7 @@ class CommentSelection extends DefaultSelection { // In order to create a referenceable comment, it needs to published. /** @var \Drupal\comment\CommentInterface $comment */ - $comment->setPublished(TRUE); + $comment->setPublished(); return $comment; } @@ -66,6 +66,8 @@ class CommentSelection extends DefaultSelection { * {@inheritdoc} */ public function entityQueryAlter(SelectInterface $query) { + parent::entityQueryAlter($query); + $tables = $query->getTables(); $data_table = 'comment_field_data'; if (!isset($tables['comment_field_data']['alias'])) { @@ -83,7 +85,7 @@ class CommentSelection extends DefaultSelection { // Passing the query to node_query_node_access_alter() is sadly // insufficient for nodes. - // @see SelectionEntityTypeNode::entityQueryAlter() + // @see \Drupal\node\Plugin\EntityReferenceSelection\NodeSelection::buildEntityQuery() if (!$this->currentUser->hasPermission('bypass node access') && !count($this->moduleHandler->getImplementations('node_grants'))) { $query->condition($node_alias . '.status', 1); }