Merge pull request #1535 from ether/fix-extractPadData
fix extract and checkPad
This commit is contained in:
commit
c986a8565a
2 changed files with 13 additions and 7 deletions
|
@ -35,7 +35,8 @@ async.series([
|
|||
function(callback) {
|
||||
settings = require('../src/node/utils/Settings');
|
||||
db = require('../src/node/db/DB');
|
||||
dirty = require("../src/node_modules/ueberDB/node_modules/dirty")(padId + ".db");
|
||||
dirty = require("../node_modules/ep_etherpad-lite/node_modules/ueberDB/node_modules/dirty")(padId + ".db");
|
||||
callback();
|
||||
},
|
||||
//intallize the database
|
||||
function (callback)
|
||||
|
@ -45,7 +46,7 @@ async.series([
|
|||
//get the pad
|
||||
function (callback)
|
||||
{
|
||||
padManager = require('../node/db/PadManager');
|
||||
padManager = require('../src/node/db/PadManager');
|
||||
|
||||
padManager.getPad(padId, function(err, _pad)
|
||||
{
|
||||
|
@ -82,7 +83,10 @@ async.series([
|
|||
db.db.db.wrappedDB.get(dbkey, function(err, dbvalue)
|
||||
{
|
||||
if(err) { callback(err); return}
|
||||
dbvalue=JSON.parse(dbvalue);
|
||||
|
||||
if(typeof dbvalue != 'object'){
|
||||
dbvalue=JSON.parse(dbvalue); // if its not json then parse it as json
|
||||
}
|
||||
|
||||
dirty.set(dbkey, dbvalue, callback);
|
||||
});
|
||||
|
|
|
@ -70,10 +70,12 @@ exports.flatten = function (lst) {
|
|||
|
||||
exports.callAll = function (hook_name, args) {
|
||||
if (!args) args = {};
|
||||
if (exports.plugins.hooks[hook_name] === undefined) return [];
|
||||
return _.flatten(_.map(exports.plugins.hooks[hook_name], function (hook) {
|
||||
return hookCallWrapper(hook, hook_name, args);
|
||||
}), true);
|
||||
if (exports.plugins){
|
||||
if (exports.plugins.hooks[hook_name] === undefined) return [];
|
||||
return _.flatten(_.map(exports.plugins.hooks[hook_name], function (hook) {
|
||||
return hookCallWrapper(hook, hook_name, args);
|
||||
}), true);
|
||||
}
|
||||
}
|
||||
|
||||
exports.aCallAll = function (hook_name, args, cb) {
|
||||
|
|
Loading…
Reference in a new issue