Skip to content
Snippets Groups Projects
Commit bb988513 authored by Gábor Hojtsy's avatar Gábor Hojtsy
Browse files

#207779 report by meba, patch by myself: missing plural formatting in forum...

#207779 report by meba, patch by myself: missing plural formatting in forum module, and a counter display fix as well
parent 28a75046
No related branches found
No related tags found
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
...@@ -760,7 +760,7 @@ function template_preprocess_forum_list(&$variables) { ...@@ -760,7 +760,7 @@ function template_preprocess_forum_list(&$variables) {
if ($user->uid) { if ($user->uid) {
$variables['forums'][$id]->new_topics = _forum_topics_unread($forum->tid, $user->uid); $variables['forums'][$id]->new_topics = _forum_topics_unread($forum->tid, $user->uid);
if ($variables['forums'][$id]->new_topics) { if ($variables['forums'][$id]->new_topics) {
$variables['forums'][$id]->new_text = t('!count new', array('!count' => $variables['forums'][$id]->new_topics)); $variables['forums'][$id]->new_text = format_plural($variables['forums'][$id]->new_topics, '1 new', '@count new');
$variables['forums'][$id]->new_url = url("forum/$forum->tid", array('fragment' => 'new')); $variables['forums'][$id]->new_url = url("forum/$forum->tid", array('fragment' => 'new'));
} }
$variables['forums'][$id]->old_topics = $forum->num_topics - $variables['forums'][$id]->new_topics; $variables['forums'][$id]->old_topics = $forum->num_topics - $variables['forums'][$id]->new_topics;
...@@ -822,7 +822,7 @@ function template_preprocess_forum_topic_list(&$variables) { ...@@ -822,7 +822,7 @@ function template_preprocess_forum_topic_list(&$variables) {
$variables['topics'][$id]->new_text = ''; $variables['topics'][$id]->new_text = '';
$variables['topics'][$id]->new_url = ''; $variables['topics'][$id]->new_url = '';
if ($topic->new_replies) { if ($topic->new_replies) {
$variables['topics'][$id]->new_text = t('!count new', array('!count' => $variables['forums'][$id]->new_topics)); $variables['topics'][$id]->new_text = format_plural($topic->new_replies, '1 new', '@count new');
$variables['topics'][$id]->new_url = url("node/$topic->nid", array('query' => comment_new_page_count($topic->num_comments, $topic->new_replies, $topic), 'fragment' => 'new')); $variables['topics'][$id]->new_url = url("node/$topic->nid", array('query' => comment_new_page_count($topic->num_comments, $topic->new_replies, $topic), 'fragment' => 'new'));
} }
......
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