diff options
author | Joas Schilling <coding@schilljs.com> | 2016-07-27 15:17:09 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2016-08-01 17:19:01 +0200 |
commit | 6430164a092760dbcf4397703ecb40209378825e (patch) | |
tree | dbb6000f427b3a55a69a068729905e324c159622 /apps | |
parent | 8a7d450fb5c80477e4414cfdf86b4737905cb8f3 (diff) | |
download | nextcloud-server-6430164a092760dbcf4397703ecb40209378825e.tar.gz nextcloud-server-6430164a092760dbcf4397703ecb40209378825e.zip |
Make sure each plugin is only added once
Diffstat (limited to 'apps')
-rw-r--r-- | apps/workflowengine/js/admin.js | 20 |
1 files 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 @@ -75,12 +75,6 @@ }); /** - * @class OCA.WorkflowEngine.AvailableCheck - */ - OCA.WorkflowEngine.AvailableCheck = - OC.Backbone.Model.extend({}); - - /** * .d8888b. 888 888 888 d8b * d88P Y88b 888 888 888 Y8P * 888 888 888 888 888 @@ -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 |