summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcatch2012-05-25 05:45:10 (GMT)
committercatch2012-05-25 05:45:10 (GMT)
commit06eed3052c7d6d9f25a538b9e954f14ea69a0331 (patch)
tree73a665691015c9fdd0fbdb02eafa9e2eee15a9e2
parent99a456c32ed8cd604b1d6f4c68e8b4d91c079a8e (diff)
Issue #1480866 by tstoeckler, adamdicarlo, sheise: Follow-up for Add type-hinting and parameter type docmentation for comment objects.
-rw-r--r--core/modules/comment/comment.pages.inc2
-rw-r--r--core/modules/comment/comment.test6
2 files changed, 7 insertions, 1 deletions
diff --git a/core/modules/comment/comment.pages.inc b/core/modules/comment/comment.pages.inc
index bac078b..0832eff 100644
--- a/core/modules/comment/comment.pages.inc
+++ b/core/modules/comment/comment.pages.inc
@@ -51,7 +51,7 @@ function comment_reply(Node $node, $pid = NULL) {
if (user_access('access comments')) {
// Load the parent comment.
$comment = comment_load($pid);
- if ($comment->status = COMMENT_PUBLISHED) {
+ if ($comment->status == COMMENT_PUBLISHED) {
// If that comment exists, make sure that the current comment and the
// parent comment both belong to the same parent node.
if ($comment->nid != $node->nid) {
diff --git a/core/modules/comment/comment.test b/core/modules/comment/comment.test
index a791b2d..1ede063 100644
--- a/core/modules/comment/comment.test
+++ b/core/modules/comment/comment.test
@@ -123,6 +123,12 @@ class CommentInterfaceTest extends CommentTestBase {
$this->assertTrue($this->commentExists($reply, TRUE), t('Page two exists. %s'));
$this->setCommentsPerPage(50);
+ // Attempt to reply to an unpublished comment.
+ $reply_loaded->status = COMMENT_NOT_PUBLISHED;
+ $reply_loaded->save();
+ $this->drupalGet('comment/reply/' . $this->node->nid . '/' . $reply_loaded->cid);
+ $this->assertText(t('The comment you are replying to does not exist.'), 'Replying to an unpublished comment');
+
// Attempt to post to node with comments disabled.
$this->node = $this->drupalCreateNode(array('type' => 'article', 'promote' => 1, 'comment' => COMMENT_NODE_HIDDEN));
$this->assertTrue($this->node, t('Article node created.'));