From 714fada9f0e3262ec64bbfcfdd9884c85f99327a Mon Sep 17 00:00:00 2001 From: Pierre Goiffon Date: Thu, 4 Oct 2018 14:56:06 +0200 Subject: [PATCH] =?UTF-8?q?N=C2=B0931=20Fix=20TagSet=20export=20:=20with?= =?UTF-8?q?=20format=3Dspreadsheet=20codes=20where=20always=20returned=20(?= =?UTF-8?q?now=20uses=20codes=20or=20labels=20according=20to=20what=20was?= =?UTF-8?q?=20set)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/attributedef.class.inc.php | 1 - core/spreadsheetbulkexport.class.inc.php | 8 +++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/core/attributedef.class.inc.php b/core/attributedef.class.inc.php index 3f7863c29..7fc74a8a5 100644 --- a/core/attributedef.class.inc.php +++ b/core/attributedef.class.inc.php @@ -9946,7 +9946,6 @@ class AttributeTagSet extends AttributeSet * @param bool $bConvertToPlainText * * @return mixed|string - * @throws \CoreException */ public function GetAsCSV( $value, $sSeparator = ',', $sTextQualifier = '"', $oHostObject = null, $bLocalize = true, diff --git a/core/spreadsheetbulkexport.class.inc.php b/core/spreadsheetbulkexport.class.inc.php index f84695f83..ad64e6add 100644 --- a/core/spreadsheetbulkexport.class.inc.php +++ b/core/spreadsheetbulkexport.class.inc.php @@ -276,6 +276,7 @@ EOF $sAttCode = $aFieldSpec['sAttCode']; $sField = ''; + /** @var \DBObject $oObj */ $oObj = $aRow[$sAlias]; if ($oObj == null) { @@ -333,11 +334,16 @@ EOF $sField = utils::TextToHtml($oObj->GetEditValue($sAttCode)); $sData .= "$sField"; } - else if($oAttDef instanceof AttributeString) + else if ($oAttDef instanceof AttributeString) { $sField = $oObj->GetAsHTML($sAttCode, $this->bLocalizeOutput); $sData .= "$sField"; } + else if ($oAttDef instanceof AttributeTagSet) + { + $sField = $oObj->GetAsCSV($sAttCode, $this->bLocalizeOutput, ''); + $sData .= "$sField"; + } else { $rawValue = $oObj->Get($sAttCode);