mirror of
https://github.com/getgrav/grav.git
synced 2026-05-05 18:35:58 +02:00
Fixed FlexObject::exists() failing sometimes just after the object has been saved
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
* Fixed non-existing Flex object having a bad media folder
|
||||
* Fixed collections using `page@.self:` should allow modular pages if requested
|
||||
* Fixed an error when trying to delete a file from non-existing Flex Object
|
||||
* Fixed `FlexObject::exists()` failing sometimes just after the object has been saved
|
||||
|
||||
# v1.6.11
|
||||
## 06/21/2019
|
||||
|
||||
@@ -550,6 +550,15 @@ class FlexObject implements FlexObjectInterface, FlexAuthorizeInterface
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME: For some reason locator caching isn't cleared for the file, investigate!
|
||||
$locator = Grav::instance()['locator'];
|
||||
$locator->clearCache();
|
||||
|
||||
// Make sure that the object exists before continuing (just in case).
|
||||
if (!$this->exists()) {
|
||||
throw new \RuntimeException('Saving failed: Object does not exist!');
|
||||
}
|
||||
|
||||
if (method_exists($this, 'saveUpdatedMedia')) {
|
||||
$this->saveUpdatedMedia();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user