fixing bug in topics causing meta tags to revert on subsequent refresh

v1.18.x
psychobunny 11 years ago
parent dbbbe21883
commit 8df33e65ac

@ -52,7 +52,6 @@ topicsController.get = function(req, res, next) {
}); });
}, },
function (topicData, next) { function (topicData, next) {
var lastMod = topicData.timestamp, var lastMod = topicData.timestamp,
description = (function() { description = (function() {
var content = ''; var content = '';
@ -75,8 +74,6 @@ topicsController.get = function(req, res, next) {
} }
} }
next(null, topicData);
var ogImageUrl = meta.config['brand:logo']; var ogImageUrl = meta.config['brand:logo'];
if(ogImageUrl && ogImageUrl.indexOf('http') === -1) { if(ogImageUrl && ogImageUrl.indexOf('http') === -1) {
ogImageUrl = nconf.get('url') + ogImageUrl; ogImageUrl = nconf.get('url') + ogImageUrl;
@ -140,7 +137,8 @@ topicsController.get = function(req, res, next) {
href: nconf.get('url') + '/category/' + topicData.category.slug href: nconf.get('url') + '/category/' + topicData.category.slug
} }
]; ];
next(null, topicData);
} }
], function (err, posts) { ], function (err, posts) {
if (err) { if (err) {

@ -165,7 +165,6 @@ middleware.renderHeader = function (options, callback) {
}; };
var uid = '0'; var uid = '0';
console.log(options.res.locals.metaTags);
// Meta Tags // Meta Tags
templateValues.metaTags = defaultMetaTags.concat(options.res.locals.metaTags || []).map(function(tag) { templateValues.metaTags = defaultMetaTags.concat(options.res.locals.metaTags || []).map(function(tag) {
if(!tag || typeof tag.content !== 'string') { if(!tag || typeof tag.content !== 'string') {

Loading…
Cancel
Save