diff --git a/BulkCommand.php b/BulkCommand.php index bb27ea52..86d16b4a 100644 --- a/BulkCommand.php +++ b/BulkCommand.php @@ -72,15 +72,15 @@ public function execute() $body = '{}'; } elseif (is_array($this->actions)) { $body = ''; - $prettyPrintSupport = property_exists('yii\\helpers\\Json', 'prettyPrint'); - if ($prettyPrintSupport) { + $prettyPrintSupported = property_exists('yii\\helpers\\Json', 'prettyPrint'); + if ($prettyPrintSupported) { $originalPrettyPrint = Json::$prettyPrint; Json::$prettyPrint = false; // ElasticSearch bulk API uses new lines as delimiters. } foreach ($this->actions as $action) { $body .= Json::encode($action) . "\n"; } - if ($prettyPrintSupport) { + if ($prettyPrintSupported) { Json::$prettyPrint = $originalPrettyPrint; } } else { diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e78001d..e390a862 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ Yii Framework 2 Elasticsearch extension Change Log 2.1.5 under development ----------------------- -- no changes in this release. +- Bug #344: Disabled JSON pretty print for ElasticSearch bulk API (rhertogh) 2.1.4 May 22, 2023