Skip to content
This repository has been archived by the owner on Sep 19, 2023. It is now read-only.

Commit

Permalink
Bug fix: Settings Form saves without validation
Browse files Browse the repository at this point in the history
  • Loading branch information
aprokopenko committed Jul 13, 2019
1 parent db2a779 commit cf0b511
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
CHANGELOG
=====================

v1.0.1
---------------------
* Bug fix: Settings Form saves without validation

v1.0
---------------------
* Component, DbComponent, Interface
Expand Down
4 changes: 4 additions & 0 deletions src/forms/SettingsForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ public function loadData()
*/
public function save()
{
if (! $this->validate()) {
return false;
}

$save = true;
foreach ($this->getAttributes() as $key => $value) {
$save &= Instance::of(SettingsInterface::class)->get()->set($this->sectionName(), $key, $value);
Expand Down

0 comments on commit cf0b511

Please sign in to comment.