diff --git a/public/src/modules/composer.js b/public/src/modules/composer.js index 192a707142..f148dc2d49 100644 --- a/public/src/modules/composer.js +++ b/public/src/modules/composer.js @@ -94,9 +94,8 @@ define(['taskbar'], function(taskbar) { var postContainer = $(composerTemplate[0]); - if(config.imgurClientIDSet) { + if(config.allowFileUploads || config.imgurClientIDSet) initializeFileReader(post_uuid); - } var postData = composer.posts[post_uuid], titleEl = postContainer.find('.title'), diff --git a/src/database/mongo.js b/src/database/mongo.js index 9f1f8ea6a9..fceb39d00f 100644 --- a/src/database/mongo.js +++ b/src/database/mongo.js @@ -269,6 +269,9 @@ module.setObjectField = function(key, field, value, callback) { var data = {}; // if there is a '.' in the field name it inserts subdocument in mongo, replace '.'s with \uff0E + if(typeof field !== 'string') { + field = field.toString(); + } field = field.replace(/\./g, '\uff0E'); data[field] = value; db.collection('objects').update({_key:key}, {$set:data}, {upsert:true, w: 1}, function(err, result) { @@ -318,7 +321,7 @@ var _fields = {}; for(var i=0; i