Skip to content

Commit

Permalink
modified version of the configuration component
Browse files Browse the repository at this point in the history
  • Loading branch information
trabem committed Jan 4, 2017
1 parent 54d8b4f commit beb3d69
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions StaticData.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
],
"require": {
"yiisoft/yii2": "*",
"yiimaker/yii2-configuration": "*"
"yiimaker/yii2-configuration": "^1.1.0"
},
"autoload": {
"psr-4": {
Expand Down

0 comments on commit beb3d69

Please sign in to comment.