From 860879ce37fd0e7d6e9c3230b20e4e25780c053a Mon Sep 17 00:00:00 2001 From: Dmitry Khrysev Date: Thu, 2 Sep 2021 14:06:38 +0300 Subject: [PATCH] Issue #78 Error when using DATE_FORMAT with PHP 8 --- src/Oro/ORM/Query/AST/Functions/String/DateFormat.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Oro/ORM/Query/AST/Functions/String/DateFormat.php b/src/Oro/ORM/Query/AST/Functions/String/DateFormat.php index 5f64a3ebdd6..f5464c45bac 100644 --- a/src/Oro/ORM/Query/AST/Functions/String/DateFormat.php +++ b/src/Oro/ORM/Query/AST/Functions/String/DateFormat.php @@ -102,7 +102,7 @@ public function parse(Parser $parser) */ private function validateFormat(Parser $parser) { - $format = str_replace('%%', '', $this->parameters[self::FORMAT_KEY]); + $format = str_replace('%%', '', (string)$this->parameters[self::FORMAT_KEY]); $unsupportedFormats = array_diff(self::$knownFormats, self::$supportedFormats); foreach ($unsupportedFormats as $unsupportedFormat) { if (strpos($format, $unsupportedFormat) !== false) {