Commit 7be65059 authored by Rob Phillips's avatar Rob Phillips
Browse files

Issue #3286597: Automated Drupal 10 compatibility fixes

parent ad33b60e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
name: 'Comment Delete'
description: 'Enhanced comment deletion rules and threaded replies handler.'
type: module
core_version_requirement: ^8.9 || ^9
core_version_requirement: ^8.9 || ^9 || ^10
dependencies:
  - drupal:comment
+2 −2
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@
        }
    ],
    "require": {
        "drupal/core": "^8.8 || ^9",
        "php": ">=7.4"
        "php": ">=7.4",
        "drupal/core": "^8.8 || ^9 || ^10"
    }
}
+2 −2
Original line number Diff line number Diff line
@@ -146,7 +146,7 @@ class CommentDeleteManager implements CommentDeleteManagerInterface {

    // Get the comments immediate replies. Each is reassigned up one thread
    // level or parent comment is entirely removed when at the topmost level.
    if ($ids = $storage->getQuery()->condition('pid', $this->comment->id())->execute()) {
    if ($ids = $storage->getQuery()->accessCheck(FALSE)->condition('pid', $this->comment->id())->execute()) {
      foreach ($storage->loadMultiple($ids) as $reply) {
        /** @var \Drupal\comment\CommentInterface $reply */
        try {
@@ -190,7 +190,7 @@ class CommentDeleteManager implements CommentDeleteManagerInterface {
    $storage = $this->entityTypeManager->getStorage('comment');

    // Hard delete if the comment has no immediate replies.
    if (!$storage->getQuery()->condition('pid', $this->comment->id())->execute()) {
    if (!$storage->getQuery()->accessCheck(FALSE)->condition('pid', $this->comment->id())->execute()) {
      return $this->hardDelete();
    }