#18870, Comment module outputs duplicate IDs for all *new* comments, backport

4.7.x
Gerhard Killesreiter 2007-01-03 21:56:58 +00:00
parent 435accd92e
commit 1289bd8a1a
1 changed files with 6 additions and 2 deletions

View File

@ -1465,10 +1465,14 @@ function theme_comment_preview($comment, $links = array(), $visible = 1) {
};
function theme_comment_view($comment, $links = array(), $visible = 1) {
static $first_new = TRUE;
// Emit selectors:
$output = '';
if (($comment->new = node_mark($comment->nid, $comment->timestamp)) != MARK_READ) {
$comment->new = node_mark($comment->nid, $comment->timestamp);
if ($first_new && $comment->new != MARK_READ) {
// Assign the anchor only for the first new comment. This avoids duplicate
// id attributes on a page.
$first_new = FALSE;
$output .= "<a id=\"new\"></a>\n";
}