From df3ca567adb9cb4d569e13f47f2dce556f0b9b50 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 27 Jul 2016 15:17:09 +0200 Subject: [PATCH] Make sure each plugin is only added once --- apps/workflowengine/js/admin.js | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/apps/workflowengine/js/admin.js b/apps/workflowengine/js/admin.js index 48d1592b457..b9f0744732f 100644 --- a/apps/workflowengine/js/admin.js +++ b/apps/workflowengine/js/admin.js @@ -74,12 +74,6 @@ } }); - /** - * @class OCA.WorkflowEngine.AvailableCheck - */ - OCA.WorkflowEngine.AvailableCheck = - OC.Backbone.Model.extend({}); - /** * .d8888b. 888 888 888 d8b * d88P Y88b 888 888 888 Y8P @@ -335,12 +329,14 @@ this._initialize('OCA\\WorkflowEngine\\Operation'); }, _initialize: function(classname) { - OCA.WorkflowEngine.availablePlugins = OC.Plugins.getPlugins('OCA.WorkflowEngine.CheckPlugins'); - _.each(OCA.WorkflowEngine.availablePlugins, function(plugin) { - if (_.isFunction(plugin.getCheck)) { - OCA.WorkflowEngine.availableChecks.push(plugin.getCheck()); - } - }); + if (!OCA.WorkflowEngine.availablePlugins.length) { + OCA.WorkflowEngine.availablePlugins = OC.Plugins.getPlugins('OCA.WorkflowEngine.CheckPlugins'); + _.each(OCA.WorkflowEngine.availablePlugins, function(plugin) { + if (_.isFunction(plugin.getCheck)) { + OCA.WorkflowEngine.availableChecks.push(plugin.getCheck(classname)); + } + }); + } this.collection.fetch({data: { 'class': classname -- 2.39.5