From 67ddd3e7f3ca7fc0d797d8b4fd43b9d601b882e7 Mon Sep 17 00:00:00 2001 From: Dries Buytaert <dries@buytaert.net> Date: Fri, 9 Oct 2009 17:05:52 +0000 Subject: [PATCH] - Patch #585838 by sun: quick fix for {comment}.status being broken. --- modules/comment/comment.module | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/comment/comment.module b/modules/comment/comment.module index d3facf4c6b4f..ea28d5417562 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -96,7 +96,7 @@ function comment_help($path, $arg) { } /** - * Implement hook_entity_info() { + * Implement hook_entity_info(). */ function comment_entity_info() { $return = array( @@ -1493,7 +1493,7 @@ protected function buildQuery() { $this->query->addField('n', 'type', 'node_type'); $this->query->innerJoin('users', 'u', 'base.uid = u.uid'); $this->query->addField('u', 'name', 'registered_name'); - $this->query->fields('u', array( 'uid', 'signature', 'picture', 'data', 'status')); + $this->query->fields('u', array('uid', 'signature', 'picture', 'data')); } protected function attachLoad(&$comments) { @@ -1665,11 +1665,11 @@ function comment_form($form, &$form_state, $comment) { $author = $comment->registered_name; } - if (!empty($comment->status)) { + if (isset($comment->status)) { $status = $comment->status; } else { - $status = 0; + $status = COMMENT_NOT_PUBLISHED; } if (!empty($comment->date)) { @@ -1742,8 +1742,8 @@ function comment_form($form, &$form_state, $comment) { '#type' => 'radios', '#parents' => array('status'), '#title' => t('Status'), - '#default_value' => $status, - '#options' => array(t('Not published'), t('Published')), + '#default_value' => $status, + '#options' => array(COMMENT_NOT_PUBLISHED => t('Not published'), COMMENT_PUBLISHED => t('Published')), '#weight' => -1, ); } -- GitLab