diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b16c48..bdcf8a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 1.5.0 - 2021-07-02 +### Changed +- Improved CSV export compatibility. + ## 1.4.0 - 2020-10-06 ### Added - Portuguese translation, thanks to [@rokam](https://www.transifex.com/user/profile/rokam/). diff --git a/main.sv-geolocation.php b/main.sv-geolocation.php index 51d08d1..0e41678 100644 --- a/main.sv-geolocation.php +++ b/main.sv-geolocation.php @@ -93,7 +93,24 @@ public function MakeRealValue($proposedValue, $oHostObj) return; } } - + + /** + * Geolocation raw value always contains comma character + * + * @param string $sValue + * @param string $sSeparator + * @param string $sTextQualifier + * @param \DBObject $oHostObject + * @param bool $bLocalize + * @param bool $bConvertToPlainText + * + * @return string + */ + public function GetAsCSV($sValue, $sSeparator = ',', $sTextQualifier = '"', $oHostObject = null, $bLocalize = true, $bConvertToPlainText = false) { + if (!empty($sValue) && strpos($sSeparator, ',') !== false) return $sTextQualifier.$sValue.$sTextQualifier; + return parent::GetAsCSV($sValue, $sSeparator, $sTextQualifier,$oHostObject, $bLocalize, $bConvertToPlainText); + } + /** * @param ormGeolocation $value * @param DBObject $oHostObject diff --git a/module.sv-geolocation.php b/module.sv-geolocation.php index fcc04ef..15f34ae 100644 --- a/module.sv-geolocation.php +++ b/module.sv-geolocation.php @@ -5,7 +5,7 @@ SetupWebPage::AddModule( __FILE__, // Path to the current file, all other file names are relative to the directory containing this file - 'sv-geolocation/1.4.0', + 'sv-geolocation/1.5.0', array( // Identification //