Fixed Blueprint::filter() returning null instead of array if there is nothing to return

This commit is contained in:
Matias Griese
2020-01-21 21:38:36 +02:00
parent cac02663e6
commit b4630aeb38
3 changed files with 3 additions and 2 deletions

View File

@@ -19,6 +19,7 @@
* Fixed `{{ false|string }}` twig to return '0' instead of ''
* Fixed `Data::filter()` removing empty fields (such as empty list) by default
* Fixed twig `url()` failing if stream has extra slash in it (e.g. `user:///data`)
* Fixed `Blueprint::filter()` returning null instead of array if there is nothing to return
* Grav 1.7: Fixed `Flex Pages` unserialize issues if Flex-Objects Plugin has not been installed
* Grav 1.7: Require Flex-Objects Plugin to edit Flex Accounts

View File

@@ -210,7 +210,7 @@ class Blueprint extends BlueprintForm
{
$this->initInternals();
return $this->blueprintSchema->filter($data, $missingValuesAsNull, $keepEmptyValues);
return $this->blueprintSchema->filter($data, $missingValuesAsNull, $keepEmptyValues) ?? [];
}

View File

@@ -84,7 +84,7 @@ class BlueprintSchema extends BlueprintSchemaBase implements ExportInterface
*/
public function filter(array $data, $missingValuesAsNull = false, $keepEmptyValues = false)
{
return $this->filterArray($data, $this->nested, $missingValuesAsNull, $keepEmptyValues);
return $this->filterArray($data, $this->nested, $missingValuesAsNull, $keepEmptyValues) ?? [];
}
/**