Commit 10f684b9 authored by webchick's avatar webchick
Browse files

Issue #2009574 by e2tha_e, adamcowboy, Samvel, jenlampton: Replace theme()...

Issue #2009574 by e2tha_e, adamcowboy, Samvel, jenlampton: Replace theme() with drupal_render() in forum module.
parent e7106ee3
......@@ -1065,7 +1065,8 @@ function template_preprocess_forum_list(&$variables) {
}
$variables['forums'][$id]->old_topics = $forum->num_topics - $variables['forums'][$id]->new_topics;
}
$variables['forums'][$id]->last_reply = theme('forum_submitted', array('topic' => $forum->last_post));
$forum_submitted = array('#theme' => 'forum_submitted', '#topic' => $forum->last_post);
$variables['forums'][$id]->last_reply = drupal_render($forum_submitted);
}
$variables['pager'] = array(
......@@ -1127,8 +1128,13 @@ function template_preprocess_forum_topic_list(&$variables) {
$variables['topics'][$id]->title = l($topic->title, 'node/' . $topic->id());
$variables['topics'][$id]->message = '';
}
$variables['topics'][$id]->created = theme('forum_submitted', array('topic' => $topic));
$variables['topics'][$id]->last_reply = theme('forum_submitted', array('topic' => isset($topic->last_reply) ? $topic->last_reply : NULL));
$forum_submitted = array('#theme' => 'forum_submitted', '#topic' => $topic);
$variables['topics'][$id]->created = drupal_render($forum_submitted);
$forum_submitted = array(
'#theme' => 'forum_submitted',
'#topic' => isset($topic->last_reply) ? $topic->last_reply : NULL,
);
$variables['topics'][$id]->last_reply = drupal_render($forum_submitted);
$variables['topics'][$id]->new_text = '';
$variables['topics'][$id]->new_url = '';
......@@ -1206,7 +1212,11 @@ function template_preprocess_forum_icon(&$variables) {
* - topic: The topic object.
*/
function template_preprocess_forum_submitted(&$variables) {
$variables['author'] = isset($variables['topic']->uid) ? theme('username', array('account' => user_load($variables['topic']->uid))) : '';
$variables['author'] = '';
if (isset($variables['topic']->uid)) {
$username = array('#theme' => 'username', '#account' => user_load($variables['topic']->uid));
$variables['author'] = drupal_render($username);
}
$variables['time'] = isset($variables['topic']->created) ? format_interval(REQUEST_TIME - $variables['topic']->created) : '';
}
......
......@@ -573,13 +573,17 @@ private function verifyForums($node_user, EntityInterface $node, $admin, $respon
$this->drupalGet('node/' . $node->id());
$this->assertResponse(200);
$this->assertTitle($node->label() . ' | Drupal', 'Forum node was displayed');
$breadcrumb = array(
$breadcrumb_build = array(
l(t('Home'), NULL),
l(t('Forums'), 'forum'),
l($this->forumContainer['name'], 'forum/' . $this->forumContainer['tid']),
l($this->forum['name'], 'forum/' . $this->forum['tid']),
);
$this->assertRaw(theme('breadcrumb', array('breadcrumb' => $breadcrumb)), 'Breadcrumbs were displayed');
$breadcrumb = array(
'#theme' => 'breadcrumb',
'#breadcrumb' => $breadcrumb_build,
);
$this->assertRaw(drupal_render($breadcrumb), 'Breadcrumbs were displayed');
// View forum edit node.
$this->drupalGet('node/' . $node->id() . '/edit');
......@@ -628,15 +632,19 @@ private function verifyForumView($forum, $parent = NULL) {
$this->assertResponse(200);
$this->assertTitle($forum['name'] . ' | Drupal');
$breadcrumb = array(
$breadcrumb_build = array(
l(t('Home'), NULL),
l(t('Forums'), 'forum'),
);
if (isset($parent)) {
$breadcrumb[] = l($parent['name'], 'forum/' . $parent['tid']);
$breadcrumb_build[] = l($parent['name'], 'forum/' . $parent['tid']);
}
$this->assertRaw(theme('breadcrumb', array('breadcrumb' => $breadcrumb)));
$breadcrumb = array(
'#theme' => 'breadcrumb',
'#breadcrumb' => $breadcrumb_build,
);
$this->assertRaw(drupal_render($breadcrumb), 'Breadcrumbs were displayed');
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment