diff --git a/src/install.js b/src/install.js
index b2e799c33f..795656d8f1 100644
--- a/src/install.js
+++ b/src/install.js
@@ -8,7 +8,6 @@ var async = require('async'),
winston = require('winston'),
nconf = require('nconf'),
utils = require('../public/src/utils.js'),
- db = require('./database.js'),
install = {
questions: [{
@@ -329,7 +328,8 @@ var async = require('async'),
},
function (next) {
// Default plugins
- var Plugins = require('./plugins');
+ var Plugins = require('./plugins'),
+ db = require('./database.js');
winston.info('Enabling default plugins');
@@ -350,7 +350,11 @@ var async = require('async'),
}, next);
},
function (next) {
- db.setObjectField('widgets:global', 'footer', "[{\"widget\":\"html\",\"data\":{\"html\":\"\",\"title\":\"\",\"container\":\"\"}}]", next);
+ var db = require('./src/database').init(function(err) {
+ if (!err) {
+ db.setObjectField('widgets:global', 'footer', "[{\"widget\":\"html\",\"data\":{\"html\":\"\",\"title\":\"\",\"container\":\"\"}}]", next);
+ }
+ });
},
function (next) {
require('./upgrade').upgrade(next);