Fixed bug in settingsv1

If the saved value was an empty string, then textareas (and more
importantly, select boxes) would not be properly populated with
the saved value.
v1.18.x
Julian Lam 9 years ago
parent 352ef81e84
commit ea6d2c35f7

@ -53,11 +53,11 @@ define('admin/settings', ['uploader', 'sounds'], function(uploader, sounds) {
}
}
} else if (field.is('textarea')) {
if (app.config[key]) {
if (app.config.hasOwnProperty(key)) {
field.val(app.config[key]);
}
} else if (field.is('select')) {
if (app.config[key]) {
if (app.config.hasOwnProperty(key)) {
field.val(app.config[key]);
}
}

@ -31,6 +31,7 @@ var Controllers = {
Controllers.home = function(req, res, next) {
var route = meta.config.homePageRoute || (meta.config.homePageCustom || '').replace(/^\/+/, '') || 'categories';
console.log(route, meta.config);
user.getSettings(req.uid, function(err, settings) {
if (err) {

Loading…
Cancel
Save