Hi, the activity stream is showing unpublished comments.

How can this be resolved?

thanks in advance

CommentFileSizeAuthor
#4 Untitled.png7.3 KBblogook
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Stalski’s picture

Status: Active » Postponed (maintainer needs more info)

In heartbeat you have two types of comment usage. When a heartbeat activity has a node involved, it will be found and together with enabled node-context configuration, heartbeat will load and post "normal drupal comments".
I checked the query and only published comments are fetched.

If not in node context, the system will use heartbeat_comments, which don't have status fields.

So could you explain what you mean by unpublished comments?

However, I can remark that you sometimes can see unpublished comments when that comment text is embedded in your heartbeat message. E.g.
!username commented on !title: !my_comment (which_is_unpublished_but_this_message_isnt)
And that is normal behavior as this is out of heartbeat's control.

blogook’s picture

The unpublished comments are shown in site activity stream.

When a user comments on a post it has to be approved before it is published by the admin. So I am guessing it is moderation status? And these comments are shown in the stream.

Stalski’s picture

Please read what I said. This is impossible, only in the way I described and that's out of heartbeat's control.

Can you send me screenshots please to make sure it are COMMENTS that are displayed unpublished.

blogook’s picture

FileSize
7.3 KB

Sure ..

Attached a screenshot, I added a comment on a blog posting saying, this is an unpublished comment. And *it is* actually an unpublished comment.

And the stream you are looking at is the site-activity stream.

Stalski’s picture

So it's a I mentioned. It's not the comment you are showing. You are embedding a comment in a heartbeat message. The message does not know if that comment is published or not.

There are two ways to look at this:
- You check the comment status at time of logging. (You could do this in the rules UI, creating a condition "When a comment is published".
The disadvantage here is that it does not represent the status of the comment at display time. So you could do this but it "might" not be enough.
- You check the comment status at display time. And this seems a little harder as I see it.

I am currently trying to fix something. The "comment id" is never written to the database, so I might have a generic solution for this one.
Hang in there.

blogook’s picture

Any help will be greatly appreciated .. as i am a complete noob when it comes to rules :)

Stalski’s picture

Status: Postponed (maintainer needs more info) » Fixed

Sidenote: Well as I said, if you are a programmer, you don't need rules. You can just use the heartbeat logging api function.

The fix:
I also added the "cid" if available in the rules UI (There you will see an extra field CID where you can assign the token for).
Heartbeat itself now checks that field as well to see if the comment is published or not. (outer join on {comment} table to check the status field)

so you see, where I can do something general, I'll do it but sometimes it's out of my hands.
Can you verify this new behavior too please?

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.