Fixed saving Flex configuration with ignored values becoming null

This commit is contained in:
Matias Griese
2020-02-06 16:52:52 +02:00
parent 6e327880a3
commit 75ee0670f6
3 changed files with 6 additions and 1 deletions

View File

@@ -8,6 +8,7 @@
* Regression: Fixed fatal error in blueprints [#2811](https://github.com/getgrav/grav/issues/2811)
* Regression: Fixed bad method call in FlexDirectory::getAuthorizeRule()
* Regression: Fixed fatal error in admin if the site has custom permissions in `onAdminRegisterPermissions`
* Grav 1.7: Fixed saving Flex configuration with ignored values becoming null
# v1.7.0-rc.5
## 02/03/2020

View File

@@ -191,6 +191,10 @@ class BlueprintSchema extends BlueprintSchemaBase implements ExportInterface
}
foreach ($data as $key => $field) {
if (null === $field && !$missingValuesAsNull) {
continue;
}
$val = $rules[$key] ?? $rules['*'] ?? null;
$rule = \is_string($val) ? $this->items[$val] : $this->items[$parent . $key] ?? null;

View File

@@ -475,7 +475,7 @@ class FlexDirectoryForm implements FlexDirectoryFormInterface, \JsonSerializable
protected function filterData($data = null): void
{
if ($data instanceof Data) {
$data->filter(true, false);
$data->filter(false, true);
}
}
}