Assure that deleted cat/keys are working as expected

- A deleted cache-key would delete a merged cache-key as well
- Deleting a key in the Model results in reloading the config to assure any value from underlying files
This commit is contained in:
Philipp 2023-01-11 21:53:34 +01:00
parent fd882abd80
commit 11a8bd17e3
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
5 changed files with 65 additions and 42 deletions

View file

@ -71,6 +71,8 @@ class Config implements IManageConfigValues
{
try {
$this->configFileManager->saveData($this->configCache);
// reload after the save to possible reload default values of lower source-priorities again
$this->reload();
} catch (ConfigFileException $e) {
throw new ConfigPersistenceException('Cannot save config', $e);
}
@ -116,7 +118,7 @@ class Config implements IManageConfigValues
/** {@inheritDoc} */
public function delete(string $cat, string $key): bool
{
if ($this->configCache->delete($cat, $key, Cache::SOURCE_DATA)) {
if ($this->configCache->delete($cat, $key)) {
$this->save();
return true;
} else {