// In order to create a referenceable comment, it needs to published.
/** @var \Drupal\comment\CommentInterface $comment */
- $comment->setPublished(TRUE);
+ $comment->setPublished();
return $comment;
}
* {@inheritdoc}
*/
public function entityQueryAlter(SelectInterface $query) {
+ parent::entityQueryAlter($query);
+
$tables = $query->getTables();
$data_table = 'comment_field_data';
if (!isset($tables['comment_field_data']['alias'])) {
// 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);
}