Fixed issue where themes without templates defined in plugin.json

did not have their templates added upon startup (backwards
compatibility re-established now)

Thanks @pichalite, for the debug!
This commit is contained in:
Julian Lam
2016-01-14 15:12:50 -05:00
parent 9836b6d464
commit 8f47a0c653

View File

@@ -153,8 +153,8 @@ var fs = require('fs'),
Plugins.showInstalled(function(err, plugins) {
async.each(plugins, function(plugin, next) {
if (plugin.templates && plugin.id && plugin.active) {
var templatesPath = path.join(__dirname, '../node_modules', plugin.id, plugin.templates);
if (plugin.id && plugin.active && (plugin.templates || plugin.id.startsWith('nodebb-theme-'))) {
var templatesPath = path.join(__dirname, '../node_modules', plugin.id, plugin.templates || 'templates');
utils.walk(templatesPath, function(err, pluginTemplates) {
if (pluginTemplates) {
pluginTemplates.forEach(function(pluginTemplate) {