diff --git a/CHANGE.md b/CHANGE.md index 61b0a3f..1b46779 100755 --- a/CHANGE.md +++ b/CHANGE.md @@ -6,9 +6,9 @@ Change Log: `yii2-export` **Date:** 12-Oct-2018 - (enh #273): Enhanced PDF Writer `ExportWriterPdf`. -- (enh #272): UTF-8 encoding for HTML, CSV, TEXT formats. +- (enh #272): Better UTF-8 encoding for CSV and TEXT formats. - (enh #271): Locale specific validation messages and code enhancements. -- (enh #270): Add iframe as default target for export form download. +- (enh #270): Add iframe as a new target option for export form download. - (enh #248): Add direct download, supplement sheets, data validation features. - (enh #204): Better event listening for dynamic export menu rendering. - (enh #120): Better init of `_columnSelectorEnabled`. diff --git a/src/ExportMenu.php b/src/ExportMenu.php index 48275c2..add172b 100644 --- a/src/ExportMenu.php +++ b/src/ExportMenu.php @@ -1127,8 +1127,7 @@ public function initPhpSpreadsheetWriter($type) $delimiter = $this->getSetting('delimiter', "\t"); $writer->setDelimiter($delimiter); } - $needsEncoding = $t === self::FORMAT_HTML || $t === self::FORMAT_CSV || $t === self::FORMAT_TEXT; - if ($this->encoding === self::ENCODING_UTF8 && $needsEncoding) { + if ($this->encoding === self::ENCODING_UTF8 && ($t === self::FORMAT_CSV || $t === self::FORMAT_TEXT)) { $writer->setUseBOM(true); } $this->raiseEvent('onInitWriter', [$this->_objWriter, $this]); @@ -1222,8 +1221,7 @@ public function setVisibleColumns() { $columns = []; foreach ($this->columns as $key => $column) { - if (!empty($column->hiddenFromExport) || $column instanceof ActionColumn || ($this->_columnSelectorEnabled - && (in_array($key, $this->noExportColumns) || !in_array($key, $this->selectedColumns)))) { + if (!empty($column->hiddenFromExport) || $column instanceof ActionColumn || in_array($key, $this->noExportColumns)) { continue; } $columns[] = $column;