Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
221
Merge Requests
221
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
f8c8827b
Commit
f8c8827b
authored
Sep 13, 2009
by
Dries
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Patch
#554164
by mfb: fixed bug with forum topic counts and added tests.
parent
0e788816
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
modules/forum/forum.module
modules/forum/forum.module
+1
-1
modules/forum/forum.test
modules/forum/forum.test
+5
-0
No files found.
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