Fixed Flex Object missing key field value when using FolderStorage

This commit is contained in:
Matias Griese 2021-07-28 14:31:55 +03:00
parent e390e9901e
commit 5437d2db1a
2 changed files with 7 additions and 0 deletions

View File

@ -11,6 +11,7 @@
* Fixed error in `loadDirectoryConfig()` if configuration hasn't been saved [#3409](https://github.com/getgrav/grav/issues/3409)
* Fixed GPM not using non-standard cache path [#3410](https://github.com/getgrav/grav/issues/3410)
* Fixed broken `environment://` stream when it doesn't have configuration
* Fixed `Flex Object` missing key field value when using `FolderStorage`
# v1.7.18
## 07/19/2021

View File

@ -380,6 +380,12 @@ class FolderStorage extends AbstractFilesystemStorage
if (isset($data[0])) {
throw new RuntimeException('Broken object file');
}
// Add key field to the object.
$keyField = $this->keyField;
if ($keyField !== 'storage_key' && !isset($data[$keyField])) {
$data[$keyField] = $key;
}
} catch (RuntimeException $e) {
$data = ['__ERROR' => $e->getMessage()];
} finally {