diff --git a/CHANGELOG.md b/CHANGELOG.md index 66985d3e5..e418939db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ * Fixed clearing cache having no effect on Doctrine cache * Fixed `Medium::relativePath()` for streams * Fixed `FlexObject::update()` call with partial object update + * Fixed `Object` serialization breaking if overriding `jsonSerialize()` method # v1.6.0-beta.6 ## 11/12/2018 diff --git a/system/src/Grav/Framework/Object/Base/ObjectTrait.php b/system/src/Grav/Framework/Object/Base/ObjectTrait.php index 395e6ad3d..4b4a4fa65 100644 --- a/system/src/Grav/Framework/Object/Base/ObjectTrait.php +++ b/system/src/Grav/Framework/Object/Base/ObjectTrait.php @@ -140,7 +140,7 @@ trait ObjectTrait */ protected function doSerialize() { - return $this->jsonSerialize(); + return ['key' => $this->getKey(), 'type' => $this->getType(), 'elements' => $this->getElements()]; } /** @@ -163,7 +163,7 @@ trait ObjectTrait */ public function jsonSerialize() { - return ['key' => $this->getKey(), 'type' => $this->getType(), 'elements' => $this->getElements()]; + return $this->doSerialize(); } /**