Skip to content
Snippets Groups Projects
Commit 039c7712 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #9031 by Morbus: this last tracker patch was broken - for installations where the comment.module is turned on, $comments is never set to 0, and posts that have no comments instead get the value of the last successful comment_num_all. The attached patch corrects this ($comments is set to 0 before we do anything) and also merges the if statements.
parent 9a56e93c
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -52,19 +52,15 @@ function tracker_page($uid = 0) {
while ($node = db_fetch_object($result)) {
// Determine the number of comments:
if (module_exist('comment')) {
if ($all = comment_num_all($node->nid)) {
$comments = $all;
if ($new = comment_num_new($node->nid)) {
$comments .= '<br />';
$comments .= l(t('%num new', array('%num' => $new)), "node/$node->nid", NULL, NULL, 'new');
}
$comments = 0;
if (module_exist('comment') && $all = comment_num_all($node->nid)) {
$comments = $all;
if ($new = comment_num_new($node->nid)) {
$comments .= '<br />';
$comments .= l(t('%num new', array('%num' => $new)), "node/$node->nid", NULL, NULL, 'new');
}
}
else {
$comments = 0;
}
$rows[] = array(
ucfirst(node_invoke($node->type, 'node_name')),
......
......@@ -52,19 +52,15 @@ function tracker_page($uid = 0) {
while ($node = db_fetch_object($result)) {
// Determine the number of comments:
if (module_exist('comment')) {
if ($all = comment_num_all($node->nid)) {
$comments = $all;
if ($new = comment_num_new($node->nid)) {
$comments .= '<br />';
$comments .= l(t('%num new', array('%num' => $new)), "node/$node->nid", NULL, NULL, 'new');
}
$comments = 0;
if (module_exist('comment') && $all = comment_num_all($node->nid)) {
$comments = $all;
if ($new = comment_num_new($node->nid)) {
$comments .= '<br />';
$comments .= l(t('%num new', array('%num' => $new)), "node/$node->nid", NULL, NULL, 'new');
}
}
else {
$comments = 0;
}
$rows[] = array(
ucfirst(node_invoke($node->type, 'node_name')),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment