diff --git a/src/controllers/topics.js b/src/controllers/topics.js index a92570b8c8..ad6681b0b5 100644 --- a/src/controllers/topics.js +++ b/src/controllers/topics.js @@ -105,8 +105,8 @@ topicsController.get = async function getTopic(req, res, next) { topicData.postIndex = postIndex; - await Promise.all([ - buildBreadcrumbs(topicData), + const [author] = await Promise.all([ + user.getUserFields(topicData.uid, ['username', 'userslug']), addOldCategory(topicData, userPrivileges), addTags(topicData, req, res), incrementViewCount(req, tid), @@ -114,6 +114,7 @@ topicsController.get = async function getTopic(req, res, next) { analytics.increment([`pageviews:byCid:${topicData.category.cid}`]), ]); + topicData.author = author; topicData.pagination = pagination.create(currentPage, pageCount, req.query); topicData.pagination.rel.forEach((rel) => { rel.href = `${url}/topic/${topicData.slug}${rel.href}`; diff --git a/src/views/partials/data/topic.tpl b/src/views/partials/data/topic.tpl index ea6fea2a3c..6a39c887f4 100644 --- a/src/views/partials/data/topic.tpl +++ b/src/views/partials/data/topic.tpl @@ -1 +1 @@ -data-index="{posts.index}" data-pid="{posts.pid}" data-uid="{posts.uid}" data-timestamp="{posts.timestamp}" data-username="{posts.user.username}" data-userslug="{posts.user.userslug}" itemscope itemtype="http://schema.org/Comment" \ No newline at end of file +data-index="{posts.index}" data-pid="{posts.pid}" data-uid="{posts.uid}" data-timestamp="{posts.timestamp}" data-username="{posts.user.username}" data-userslug="{posts.user.userslug}" itemprop="comment" itemtype="http://schema.org/Comment" itemscope \ No newline at end of file