I find the notification of incoming comments which need moderation a little weak.
So I've added a Pending Comments block which is visible for sufficiently priv'd users.

Caveat: I may not have done sufficient research to determine whether this issue has
been discussed already. This patch came about mostly as an exercise in hacking
Drupal, which continues to impress me with how well structured and extensible it is.

Comments

Hybernaut’s picture

I'm not entirely happy with this: the links in the block point to /comment/edit/$comment-id, while you really want
to go to the comment moderation page (/comment/list/approval). Any thoughts on this?

forngren’s picture

Version: 4.5.2 » x.y.z
LAs4n’s picture

Version: x.y.z » 7.x-dev

Feature request, moving to cvs.

tstoeckler’s picture

Version: 7.x-dev » 8.x-dev

Bumping.
This is still a valid feature request.

dixon_’s picture

Status: Active » Closed (won't fix)

I'd say this is very easy to fix in contrib, with a very simple View. If one would like to expose the comment approval queue better in D7 there's the Shortcut module that can be used for appropriate roles.

tstoeckler’s picture

Status: Closed (won't fix) » Active

Re-opening, at least for as long as dashboard.module still lives in core. This is an obvious candidate for that. We enable Comment module in the Standard profile so we should provide this.

tstoeckler’s picture

Oh, and sorry for not stating that:
1. The fact that Views does something isn't really an argument. This would be a out-of-the-box/product feature.
2. On the comments page, you need to select the appropriate filters first (and I don't Shortcut handles that, though I could be wrong), and it's not as handy as directly having it as a block.

James_Stallings’s picture

Assigned: Unassigned » James_Stallings
James_Stallings’s picture

Status: Active » Needs review
StatusFileSize
new0 bytes
James_Stallings’s picture

Assigned: James_Stallings » Unassigned
tstoeckler’s picture

That's an empty patch... :)

James_Stallings’s picture

take 2 :)

bryanhirsch’s picture

Re-rolled by Boston Initiative. Applies cleanly at commit 718fe5d90770f36335053d6f92fc53f73ac95951.

Status: Needs review » Needs work

The last submitted patch, pending_comment_block_patch3-19734-4945142.patch, failed testing.

andypost’s picture

Version: 8.0.x-dev » 8.1.x-dev
Issue summary: View changes
Status: Needs work » Postponed

This should be implemnted as a view

moshe weitzman’s picture

Status: Postponed » Active

This is still a good feature request, 10.5 years later.

kylebrowning’s picture

heres a patch for that.

kylebrowning’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 17: add-unapproved-comment-block-19734-17.patch, failed testing.

kylebrowning’s picture

Status: Needs work » Needs review

Hmmm...

andypost’s picture

Version: 8.1.x-dev » 8.0.x-dev
Issue tags: +Needs tests

8.1 branch is broken, temporary switch to 8.0

Status: Needs review » Needs work

The last submitted patch, 17: add-unapproved-comment-block-19734-17.patch, failed testing.

andypost’s picture

Version: 8.0.x-dev » 8.1.x-dev
Status: Needs work » Postponed
kylebrowning’s picture

All of the errors seem to be saying the view is already enabled?

kylebrowning’s picture

Version: 8.1.x-dev » 8.0.x-dev
Status: Postponed » Needs review

kylebrowning’s picture

StatusFileSize
new354.02 KB

Heres a picture of the view placed in a block.

Screenshot

Status: Needs review » Needs work

The last submitted patch, 17: add-unapproved-comment-block-19734-17.patch, failed testing.

kylebrowning’s picture

Yeah i don't get why its failing. :/ Any insight?

eclipsegc’s picture

--- /dev/null
+++ b/core/modules/comment/config/optional/views.view.comments_moderated_recent.yml

@@ -0,0 +1,264 @@
+id: comments_recent_unapproved

I suspect the conflict in names here has something to do with the test problems.

kylebrowning’s picture

Status: Needs work » Needs review
StatusFileSize
new7.13 KB

renaming file.

Status: Needs review » Needs work

The last submitted patch, 32: add-unapproved-comment-block-19734-31.patch, failed testing.

kylebrowning’s picture

StatusFileSize
new1.15 KB
new8.28 KB

Adds to the setup function so that tests do not fail.

kylebrowning’s picture

Status: Needs work » Needs review

The last submitted patch, 32: add-unapproved-comment-block-19734-31.patch, failed testing.

moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community

Looks proper and useful to me.

xjm’s picture

Version: 8.0.x-dev » 8.1.x-dev
Status: Reviewed & tested by the community » Postponed

As a new feature, this change is postponed until 8.1.x. More details: https://www.drupal.org/core/beta-changes

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

Drupal 8.1.0-beta1 was released on March 2, 2016, which means new developments and disruptive changes should now 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.

kylebrowning’s picture

Status: Postponed » Reviewed & tested by the community
Issue tags: -Needs tests

Not sure how this missed 8.1.x but thats fine.

catch’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs issue summary update, +Needs usability review, +Needs product manager review
+++ b/core/modules/views/src/Tests/DefaultViewsTest.php
@@ -102,6 +102,16 @@ protected function setUp() {
+      //Create an unpublished comment for default views

Missing a space and a full-stop.

I agree with #5 though, especially now that Views is in core. We already have the default 'archive' and 'glossary' views in core which should never have been added in the first place (it was literally forgotten to remove them from the initial views in core patch) - they mostly just take up space on admin/structure/views.

So I think we need more in the issue summary as to why we'd add this block to core. It's only useful if you 1. have comments set to moderation 2. find the block and enable it - assuming you don't have another way to get notifications.

Additionally, unless I'm mistaken, this won't only show 'pending' comments, it will also show unpublished comments since we have a single boolean status column.

Let's say you have a site where comments are not set to moderation. However you get an abusive comment on the site, and unpublish it.

Won't that comment now show in the block on every page in the site? It's not pending, you unpublished it because you don't want to see it. The only way not to have the block showing everywhere now would be 1. publish the comment (not an option) 2. Delete the comment (might not be an option) 3. Disable the block

catch’s picture

Just applied the patch to the standard profile to do some quick testing. Comments aren't moderated.

The first screenshot is after posting a comment - it tells me there are no recent comments when there are, since the block doesn't specifically mention unapproved comments in the title anyway. Also it probably shouldn't show at all if there's nothing to approve.

The second screenshot is after unpublishing the comment I just posted.

catch’s picture

StatusFileSize
new60.34 KB
wim leers’s picture

I agree with #5 though, especially now that Views is in core. We already have the default 'archive' and 'glossary' views in core which should never have been added in the first place (it was literally forgotten to remove them from the initial views in core patch) - they mostly just take up space on admin/structure/views.

But #5 says it's easy to do with Views. We now have Views in core. I think it makes sense to ship with a view like this? I think it's fine to have the "archive" and "glossary" views in core available too, because they are useful examples of what is possible. This would be another such case.

However…

Additionally, unless I'm mistaken, this won't only show 'pending' comments, it will also show unpublished comments since we have a single boolean status column.

This indeed sucks :(

Bojhan’s picture

I am unsure about this idea, we generally avoid creating blocks that are of no use to visitors of the website. Given that this is customisation that is only applicable to websites, who use comments - the audience of a view like this is limited.

dawehner’s picture

I have to agree with the points made by catch/wim/Bojhan ... its great to see that views enables us to build such blocks for editors easily. Most of the time though you want this role to just be visible for a custom role anyway, which we cannot know, so people would also have to change the view all the time. Given that the pratical use is rather limited. If people don't know yet how to use views but want this kind of functionality, they also have the recent comments view provided, which provides a similar baseline to start wtih.

I would kinda vote for: Postponed, let's create maybe a blog entry about it.

Bojhan’s picture

Status: Needs work » Postponed

I think this merits enough input to conclude this postponed.

kylebrowning’s picture

Why not just close, won't fix.

dawehner’s picture

I agree, postpone is a weird status here.

yoroy’s picture

Status: Postponed » Closed (won't fix)

Just based on reading this issue's title I came in to write something similar to what @Bojhan said. Additional arguments by @catch & @dawehner: very limited use case, not a user facing feature, crowding the blocks listing page and: it just can't be made to work well because unpublished comments will be shown as well.

So, lets just not do this.

webchick’s picture