From beb3d69ca9efeb1c59031b3108251963a425e613 Mon Sep 17 00:00:00 2001 From: Ruslan Saiko Date: Wed, 4 Jan 2017 16:25:12 +0200 Subject: [PATCH] modified version of the configuration component --- StaticData.php | 8 ++++++-- composer.json | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/StaticData.php b/StaticData.php index 750535e..a80138c 100644 --- a/StaticData.php +++ b/StaticData.php @@ -100,10 +100,14 @@ public function save() $config = $this->getConfiguration(); $attributes = $this->getAttributes(); + $saved = true; foreach ($attributes as $key => $value) { - $config->set($this->getAttributeName($key), $value); + if ($config->safeSet($this->getAttributeName($key), $value)) { + $this->addError($key, 'Something went wrong. More details in the logs.'); + $saved = false; + } } - $this->afterSave(); + $this->afterSave($saved); return true; } diff --git a/composer.json b/composer.json index 2233f18..b8b7747 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ ], "require": { "yiisoft/yii2": "*", - "yiimaker/yii2-configuration": "*" + "yiimaker/yii2-configuration": "^1.1.0" }, "autoload": { "psr-4": {