diff options
author | Thomas Steur <thomas.steur@googlemail.com> | 2014-04-03 23:43:36 +0400 |
---|---|---|
committer | Thomas Steur <thomas.steur@googlemail.com> | 2014-04-03 23:43:36 +0400 |
commit | a12cf721b04e22eb3a8d3c0d82397687faa34aed (patch) | |
tree | 488c1e3d421e0346b37a3a727db839411a22e996 /plugins | |
parent | 6008898c699521e34a5b6156d54787f66eb9450b (diff) |
if already installed, do not install it again
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/CustomVariables/Commands/SetNumberOfCustomVariables.php | 4 | ||||
-rw-r--r-- | plugins/CustomVariables/Model.php | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/plugins/CustomVariables/Commands/SetNumberOfCustomVariables.php b/plugins/CustomVariables/Commands/SetNumberOfCustomVariables.php index 7bd7a8d43f..60cd63ee55 100644 --- a/plugins/CustomVariables/Commands/SetNumberOfCustomVariables.php +++ b/plugins/CustomVariables/Commands/SetNumberOfCustomVariables.php @@ -115,8 +115,8 @@ class SetNumberOfCustomVariables extends ConsoleCommand $maxCustomVars = (int) $maxCustomVars; - if ($maxCustomVars <= 0) { - throw new \Exception('There has to be at least one custom variable'); + if ($maxCustomVars <= 1) { + throw new \Exception('There has to be at least two custom variables'); } return $maxCustomVars; diff --git a/plugins/CustomVariables/Model.php b/plugins/CustomVariables/Model.php index c2c425b06e..cb400bbbdf 100644 --- a/plugins/CustomVariables/Model.php +++ b/plugins/CustomVariables/Model.php @@ -156,6 +156,10 @@ class Model foreach (self::getScopes() as $scope) { $model = new Model($scope); + if ($model->getCurrentNumCustomVars() >= 5) { + continue; + } + try { for ($index = 0; $index < 5; $index++) { $model->addCustomVariable(); |