Commit f6e7a9c6 authored by catch's avatar catch

Issue #1796292 by superspring, YesCT, EllaTheHarpy: Fixed Use of undeclared...

Issue #1796292 by superspring, YesCT, EllaTheHarpy: Fixed Use of undeclared variable : $original_title() in core/modules/forum/forum.module on line 1232.
parent 4c4d8605
......@@ -1154,7 +1154,7 @@ function template_preprocess_forum_topic_list(&$variables) {
$variables['topics'][$id]->new_text = '';
$variables['topics'][$id]->new_url = '';
if ($topic->new_replies) {
$variables['topics'][$id]->new_text = format_plural($topic->new_replies, '1 new post<span class="element-invisible"> in topic %title</span>', '@count new posts<span class="element-invisible"> in topic %title</span>', array('%title' => $original_title));
$variables['topics'][$id]->new_text = format_plural($topic->new_replies, '1 new post<span class="element-invisible"> in topic %title</span>', '@count new posts<span class="element-invisible"> in topic %title</span>', array('%title' => $variables['topics'][$id]->title));
$variables['topics'][$id]->new_url = url("node/$topic->nid", array('query' => comment_new_page_count($topic->comment_count, $topic->new_replies, $topic), 'fragment' => 'new'));
}
......
......@@ -82,6 +82,7 @@ function setUp() {
'administer menu',
'administer taxonomy',
'create forum content',
'access comments',
));
$this->edit_any_topics_user = $this->drupalCreateUser(array(
'access administration pages',
......@@ -95,6 +96,13 @@ function setUp() {
'delete own forum content',
));
$this->web_user = $this->drupalCreateUser();
$this->post_comment_user = $this->drupalCreateUser(array(
'administer content types',
'create forum content',
'post comments',
'skip comment approval',
'access comments',
));
}
/**
......@@ -441,6 +449,35 @@ private function doBasicTests($user, $admin) {
$this->verifyForums($user, $node, $admin);
}
/**
* Tests a forum with a new post displays properly.
*/
function testForumWithNewPost() {
// Login as the first user.
$this->drupalLogin($this->admin_user);
// Create a forum container.
$this->container = $this->createForum('container');
// Create a forum.
$this->forum = $this->createForum('forum');
// Create a topic.
$node = $this->createForumTopic($this->forum, FALSE);
// Login as a second user.
$this->drupalLogin($this->post_comment_user);
// Post a reply to the topic.
$edit = array();
$edit['subject'] = $this->randomName();
$edit['comment_body[' . LANGUAGE_NOT_SPECIFIED . '][0][value]'] = $this->randomName();
$this->drupalPost("node/$node->nid", $edit, t('Save'));
$this->assertResponse(200);
// Login as the first user.
$this->drupalLogin($this->admin_user);
// Check that forum renders properly.
$this->drupalGet("forum/{$this->forum['tid']}");
$this->assertResponse(200);
}
/**
* Creates a forum topic.
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment