Fixed FlexObject::getChanges() always returning empty array

This commit is contained in:
Matias Griese 2021-11-11 15:48:18 +02:00
parent 58b48c2f26
commit 33b473c290
2 changed files with 5 additions and 2 deletions

View File

@ -11,6 +11,7 @@
* Fixed path traversal vulnerability when using `bin/grav server`
* Fixed unescaped error messages in JSON error responses
* Fixed `|t(variable)` twig filter in admin
* Fixed `FlexObject::getChanges()` always returning empty array
# v1.7.24
## 10/26/2021

View File

@ -666,8 +666,10 @@ class FlexObject implements FlexObjectInterface, FlexAuthorizeInterface
}
// Store the changes
$this->_original = $this->getElements();
$this->_changes = Utils::arrayDiffMultidimensional($this->_original, $elements);
if ($this->_original === null) {
$this->_original = $elements;
}
$this->_changes = Utils::arrayDiffMultidimensional($this->_original, $this->getElements());
}
if ($files && method_exists($this, 'setUpdatedMedia')) {