Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
f8c8827b
Commit
f8c8827b
authored
Sep 13, 2009
by
Dries
Browse files
- Patch
#554164
by mfb: fixed bug with forum topic counts and added tests.
parent
0e788816
Changes
2
Hide whitespace changes
Inline
Side-by-side
modules/forum/forum.module
View file @
f8c8827b
...
...
@@ -623,7 +623,7 @@ function forum_get_forums($tid = 0) {
if
(
count
(
$_forums
))
{
$query
=
db_select
(
'node'
,
'n'
);
$query
->
join
(
'node_comment_statistics'
,
'ncs'
,
'n.nid = ncs.nid'
);
$query
->
join
(
'forum'
,
'f'
,
'
f
.vid = f.vid'
);
$query
->
join
(
'forum'
,
'f'
,
'
n
.vid = f.vid'
);
$query
->
addExpression
(
'COUNT(n.nid)'
,
'topic_count'
);
$query
->
addExpression
(
'SUM(ncs.comment_count)'
,
'comment_count'
);
$counts
=
$query
...
...
modules/forum/forum.test
View file @
f8c8827b
...
...
@@ -63,6 +63,11 @@ class ForumTestCase extends DrupalWebTestCase {
$this
->
drupalLogin
(
$this
->
any_user
);
// Verify the any forum user has access to all the forum nodes.
$this
->
verifyForums
(
$this
->
own_user
,
$node
,
TRUE
);
// Verify the topic and post counts on the forum page.
$this
->
drupalGet
(
'forum'
);
$this
->
assertRaw
(
"<td class=
\"
topics
\"
>
\n
6 </td>"
);
$this
->
assertRaw
(
'<td class="posts">6</td>'
);
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment