Issue #1480866 by tstoeckler, adamdicarlo, sheise: Follow-up for Add type-hinting and parameter type docmentation for comment objects.

8.0.x
catch 2012-05-25 14:45:10 +09:00
parent 99a456c32e
commit 06eed3052c
2 changed files with 7 additions and 1 deletions

View File

@ -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) {

View File

@ -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.'));