diff --git a/core/modules/comment/lib/Drupal/comment/Plugin/Core/Entity/Comment.php b/core/modules/comment/lib/Drupal/comment/Plugin/Core/Entity/Comment.php index ddda09c..aedc2b2 100644 --- a/core/modules/comment/lib/Drupal/comment/Plugin/Core/Entity/Comment.php +++ b/core/modules/comment/lib/Drupal/comment/Plugin/Core/Entity/Comment.php @@ -266,7 +266,7 @@ public function preSave(EntityStorageControllerInterface $storage_controller) { if (is_null($this->getNodeType())) { $this->set('node_type', 'comment_node_' . $this->getNode()->type); } - if ($this->isNewForUser()) { + if ($this->isNew()) { // Add the comment to database. This next section builds the thread field. // Also see the documentation for comment_view(). if (is_null($this->getThread())) { @@ -372,7 +372,7 @@ public static function postDelete(EntityStorageControllerInterface $storage_cont entity_delete_multiple('comment', $child_cids); foreach ($entities as $id => $entity) { - $storage_controller->updateNodeStatistics($entity->nid->target_id); + $storage_controller->updateNodeStatistics($entity->getNodeId()); } }