mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 03:55:55 +01:00
dont crash if config is undefined, added error to plugins
This commit is contained in:
@@ -463,8 +463,8 @@ middleware.processRender = function(req, res, next) {
|
|||||||
if (res.locals.renderHeader) {
|
if (res.locals.renderHeader) {
|
||||||
middleware.renderHeader(req, res, function(err, template) {
|
middleware.renderHeader(req, res, function(err, template) {
|
||||||
str = template + str;
|
str = template + str;
|
||||||
|
var language = res.locals.config ? res.locals.config.userLang || 'en_GB' : 'en_GB';
|
||||||
translator.translate(str, res.locals.config.userLang, function(translated) {
|
translator.translate(str, language, function(translated) {
|
||||||
fn(err, translated);
|
fn(err, translated);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -568,7 +568,7 @@ middleware.publicTagListing = function(req, res, next) {
|
|||||||
middleware.ensureLoggedIn(req, res, next);
|
middleware.ensureLoggedIn(req, res, next);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
module.exports = function(webserver) {
|
module.exports = function(webserver) {
|
||||||
app = webserver;
|
app = webserver;
|
||||||
|
|||||||
@@ -615,6 +615,7 @@ var fs = require('fs'),
|
|||||||
pluginMap[plugin.id].description = plugin.description;
|
pluginMap[plugin.id].description = plugin.description;
|
||||||
pluginMap[plugin.id].url = pluginMap[plugin.id].url || plugin.url;
|
pluginMap[plugin.id].url = pluginMap[plugin.id].url || plugin.url;
|
||||||
pluginMap[plugin.id].installed = true;
|
pluginMap[plugin.id].installed = true;
|
||||||
|
pluginMap[plugin.id].error = plugin.error;
|
||||||
pluginMap[plugin.id].active = plugin.active;
|
pluginMap[plugin.id].active = plugin.active;
|
||||||
pluginMap[plugin.id].error = pluginMap[plugin.id].error || false;
|
pluginMap[plugin.id].error = pluginMap[plugin.id].error || false;
|
||||||
pluginMap[plugin.id].version = plugin.version;
|
pluginMap[plugin.id].version = plugin.version;
|
||||||
|
|||||||
Reference in New Issue
Block a user