Skip to content

Commit

Permalink
fix(settings): improve saving settings
Browse files Browse the repository at this point in the history
  • Loading branch information
EdieLemoine committed Nov 6, 2023
1 parent 1a86415 commit b313793
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Configuration/Service/Ps17PsConfigurationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ public function has(string $key, ShopConstraint $shopConstraint = null): bool
*/
public function set(string $key, $value, ShopConstraint $shopConstraint = null): void
{
$this->configurationService->set($key, json_encode($value), $shopConstraint);
$storableValue = is_scalar($value) ? $value : json_encode($value);

$this->configurationService->set($key, $storableValue, $shopConstraint);
}
}
1 change: 1 addition & 0 deletions src/Pdk/Settings/Repository/PdkSettingsRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,6 @@ public function store(string $key, $value): void
}

$this->configurationService->set($key, $value);
$this->save($key, $value);
}
}

0 comments on commit b313793

Please sign in to comment.