mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-11 08:25:46 +01:00
closes #5010
init plugin hooks before resetting widgets, the areas are returned by `filter:widgets.getAreas`
This commit is contained in:
13
src/reset.js
13
src/reset.js
@@ -10,7 +10,6 @@ var events = require('./events');
|
|||||||
|
|
||||||
var Reset = {};
|
var Reset = {};
|
||||||
|
|
||||||
|
|
||||||
Reset.reset = function (callback) {
|
Reset.reset = function (callback) {
|
||||||
db.init(function (err) {
|
db.init(function (err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
@@ -163,10 +162,14 @@ function resetPlugins(callback) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function resetWidgets(callback) {
|
function resetWidgets(callback) {
|
||||||
require('./widgets').reset(function (err) {
|
async.waterfall([
|
||||||
winston.info('[reset] All Widgets moved to Draft Zone');
|
require('./plugins').reload,
|
||||||
callback(err);
|
require('./widgets').reset,
|
||||||
});
|
function (next) {
|
||||||
|
winston.info('[reset] All Widgets moved to Draft Zone');
|
||||||
|
next();
|
||||||
|
},
|
||||||
|
], callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Reset;
|
module.exports = Reset;
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ widgets.reset = function (callback) {
|
|||||||
function (results, next) {
|
function (results, next) {
|
||||||
drafts = results.drafts || [];
|
drafts = results.drafts || [];
|
||||||
|
|
||||||
async.each(results.areas, function (area, next) {
|
async.eachSeries(results.areas, function (area, next) {
|
||||||
async.waterfall([
|
async.waterfall([
|
||||||
function (next) {
|
function (next) {
|
||||||
widgets.getArea(area.template, area.location, next);
|
widgets.getArea(area.template, area.location, next);
|
||||||
|
|||||||
Reference in New Issue
Block a user