Fixed Flex Object saving causing the key to be lost for some types

This commit is contained in:
Matias Griese
2019-09-17 19:42:28 +03:00
parent df51b64b35
commit f201d48112

View File

@@ -653,9 +653,13 @@ class FlexObject implements FlexObjectInterface, FlexAuthorizeInterface
}
$storageKey = $meta['storage_key'] ?? (string)key($result);
if ($value && $storageKey) {
$this->setStorageKey($storageKey);
$this->setKey($meta['key'] ?? $storageKey);
if ($value) {
if ($storageKey) {
$this->setStorageKey($storageKey);
}
$newKey = $meta['key'] ?? ($this->hasKey() ? $this->getKey() : null);
$this->setKey($newKey ?? $storageKey);
}
// FIXME: For some reason locator caching isn't cleared for the file, investigate!