- Patch #601938 by mfb: fixed some forum exceptions and added tests.

merge-requests/26/head
Dries Buytaert 2009-10-20 00:28:16 +00:00
parent 07eee25abe
commit eeb7b53ef6
3 changed files with 9 additions and 4 deletions

View File

@ -902,7 +902,7 @@ class SelectQuery extends Query implements SelectQueryInterface {
/* Implementations of QueryConditionInterface for the WHERE clause. */ /* Implementations of QueryConditionInterface for the WHERE clause. */
public function condition($field, $value = NULL, $operator = '=') { public function condition($field, $value = NULL, $operator = NULL) {
if (!isset($num_args)) { if (!isset($num_args)) {
$num_args = func_num_args(); $num_args = func_num_args();
} }

View File

@ -254,9 +254,7 @@ function forum_update_7001() {
'taxonomy_term_data' => 'tid', 'taxonomy_term_data' => 'tid',
), ),
); );
db_create_table($ret, 'forum_index', $forum_index); db_create_table('forum_index', $forum_index);
db_query('INSERT INTO {forum_index} (SELECT n.nid, n.title, f.tid, n.sticky, n.created, ncs.last_comment_timestamp, ncs.comment_count FROM {node} n INNER JOIN {forum} f on n.vid = f.vid INNER JOIN {node_comment_statistics} ncs ON n.nid = ncs.nid)'); db_query('INSERT INTO {forum_index} (SELECT n.nid, n.title, f.tid, n.sticky, n.created, ncs.last_comment_timestamp, ncs.comment_count FROM {node} n INNER JOIN {forum} f on n.vid = f.vid INNER JOIN {node_comment_statistics} ncs ON n.nid = ncs.nid)');
return $ret;
} }

View File

@ -68,6 +68,13 @@ class ForumTestCase extends DrupalWebTestCase {
$this->drupalGet('forum'); $this->drupalGet('forum');
$this->assertRaw("<td class=\"topics\">\n 6 </td>"); $this->assertRaw("<td class=\"topics\">\n 6 </td>");
$this->assertRaw('<td class="posts">6</td>'); $this->assertRaw('<td class="posts">6</td>');
// Test loading multiple forum nodes on the front page.
$this->drupalLogin($this->drupalCreateUser(array('administer content types', 'create forum content')));
$this->drupalPost('admin/structure/types/manage/forum', array('node_options[promote]' => 'promote'), t('Save content type'));
$this->createForumTopic($this->forum, FALSE);
$this->createForumTopic($this->forum, FALSE);
$this->drupalGet('node');
} }
/** /**