Problem/Motivation

It is impossible for an administrator to delete comments for a closed for comment entity (D8) or node (D7)

Steps to reproduce

  1. As user 1 or as user with 'Post comment' and 'Administer comments' permission
  2. Create a node which has comments enabled.
  3. Create a comment on the node
  4. Check for the delete link for created comment.
  5. Edit the node and close for comments
  6. Check for the delete link for created comment. There is none :-(

Proposed resolution

Fix it.

Remaining tasks

User interface changes

API changes

CommentFileSizeAuthor
#1 delete_comment_on-2427995-1-D7-do-not-test.patch1.39 KBclemens.tolboom
#1 delete_comment_on-2427995-1.patch775 bytesclemens.tolboom
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 86,956 pass(es). View
Members fund testing for the Drupal project. Drupal Association Learn more

Comments

clemens.tolboom’s picture

Status: Active » Needs review
FileSize
775 bytes
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 86,956 pass(es). View
1.39 KB
clemens.tolboom’s picture

Issue summary: View changes
clemens.tolboom’s picture

+++ b/core/modules/comment/src/CommentPostRenderCache.php
@@ -190,7 +190,7 @@ protected function buildLinks(CommentInterface $entity, EntityInterface $comment
+    if ($status == CommentItemInterface::OPEN || (CommentItemInterface::CLOSED && $this->currentUser->hasPermission('administer comments'))) {

Why bother on CommentItemInterface::CLOSED ? Is 'administer comments' not enough?

pcambra’s picture

Issue tags: +Needs tests
ameymudras’s picture

Assigned: Unassigned » ameymudras
ameymudras’s picture

Assigned: ameymudras » Unassigned
pjonckiere’s picture

Status: Needs review » Needs work

Re #3: just checking for the permission seems enough to me.

If we are changing this behaviour for delete, shouldn't we do the same for reply and comment? I think the reply action will be handled once #221761: Comment admins cannot reply to unpublished comments (despite link) goes in.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.