I have searched and can't believe this has not been requested before. I want to filter out unpublished comments (status = 1), but that doesn't seem to be an option. This seems an incomprehensible oversight to me. [If I knew Views coding well enough to post a patch, I would have.]

Comments

merlinofchaos’s picture

Status: Active » Fixed

It's called "Comment: In Moderation" mostly due to the history of the field.

NancyDru’s picture

Title: Filter on comment status » Make comment status consistent with core
Status: Fixed » Active

Then let's make this consistent with core. The admin/content/comment pages use the terms "publish" and "unpublish" (consistent with nodes, for which "moderation" was a different function. Even D5 used these terms. I've been doing Drupal for 4 years and have never heard of comments heard of comments being moderated; they may be awaiting "approval."

NancyDru’s picture

  // status (approved or not)
  $data['comments']['status'] = array(
    'title' => t('Published'),
    'help' => t('Whether or not the comment is currently published.'),
    'field' => array(
      'handler' => 'views_handler_field_boolean',
      'click sortable' => TRUE,
    ),
    'filter' => array(
      'handler' => 'views_handler_filter_boolean_operator',
      'label' => t('Published'),
      'type' => 'yes-no',
    ),
    'sort' => array(
      'handler' => 'views_handler_sort',
    ),
  );

At the moment, I am on a loner PC, so don't have the ability to make a patch.

merlinofchaos’s picture

Assigned: Unassigned » dawehner
Category: feature » task

You have to be careful with this. Prior to D7, at least, the actual meaning of the flag was reversed from core's usage of it. i.e, status = 1 meant published for a node, but status = 1 meant not published for a comment. I know this changed, though I can't remember precisely when it changed now. Doing a quick look at a D6 database, 0 means published.

That means that you have to actually reverse the value. That's the real reason Views used slightly different terminology. Either way you approach it, there is going to be some confusion. At the time, I chose one confusion over another.

For D6, we should probably just leave it as is. However, in D7 since I believe the value of the flag is reversed, we should go ahead and make this change.

Assigning to dereine -- do you agree with me on this?

NancyDru’s picture

Yes, I am aware of the difference between comment status and node status. Last I heard the D7 reversal was reversed and it is back to the way it has been.

merlinofchaos’s picture

And the reason this matters is that the boolean field handler assumes 1 == Yes. But for Comment: Published 1 == no. So the values need to be reversed. I don't remember if it can reverse the values automatically or not.

NancyDru’s picture

Fields can, but filters cannot, apparently. So I just checked for "No" when I want "yes." I can live with it for now, especially since I, so far, have not gotten the view to give me counts rather than the actual comments.

MustangGB’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)