diff --git a/CHANGELOG.md b/CHANGELOG.md index 45ce10ac0..8a815a496 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ * Fixed pages with session messages should never be cached [#3108](https://github.com/getgrav/grav/issues/3108) * Fixed `Filesystem::normalize()` with dot-dot paths * Fixed Flex sorting issues [grav-plugin-flex-objects#92](https://github.com/trilbymedia/grav-plugin-flex-objects/issues/92) + * Fixed Clockwork missing dumped arrays and objects # v1.7.0-rc.20 ## 12/15/2020 diff --git a/system/src/Grav/Common/Debugger.php b/system/src/Grav/Common/Debugger.php index f4548eb6b..6b7e49a3a 100644 --- a/system/src/Grav/Common/Debugger.php +++ b/system/src/Grav/Common/Debugger.php @@ -743,18 +743,19 @@ class Debugger } if ($this->clockwork) { + $context = $isString; if (!is_scalar($message)) { - $isString = $message; - $message = ''; + $context = $message; + $message = gettype($context); } - if (is_bool($isString)) { - $isString = []; + if (is_bool($context)) { + $context = []; + } elseif (!is_array($context)) { + $type = gettype($context); + $context = [$type => $context]; } - if (!is_array($isString)) { - $type = gettype($isString); - $isString = [$type => $isString]; - } - $this->clockwork->log($label, $message, $isString); + + $this->clockwork->log($label, $message, $context); } }