diff options
author | benakamoorthi <benaka.moorthi@gmail.com> | 2012-11-15 14:39:18 +0400 |
---|---|---|
committer | benakamoorthi <benaka.moorthi@gmail.com> | 2012-11-15 14:39:18 +0400 |
commit | c775c64ec484ac52ce10773948ce28bcb2467c42 (patch) | |
tree | 169ba51a51adf8ec6451a13f203fe4022a029361 /plugins/UserCountry | |
parent | 979028ea9b24bd389606ab439c850d1d0e00395d (diff) |
Fixes #3511, store lat/long in archived table metadata instead of label.
git-svn-id: http://dev.piwik.org/svn/trunk@7478 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'plugins/UserCountry')
-rw-r--r-- | plugins/UserCountry/API.php | 6 | ||||
-rw-r--r-- | plugins/UserCountry/UserCountry.php | 6 |
2 files changed, 7 insertions, 5 deletions
diff --git a/plugins/UserCountry/API.php b/plugins/UserCountry/API.php index 0309dc01d8..b684ebdb41 100644 --- a/plugins/UserCountry/API.php +++ b/plugins/UserCountry/API.php @@ -130,10 +130,12 @@ class Piwik_UserCountry_API array('label', 'region', 'Piwik_UserCountry_getElementFromStringArray', array($separator, 1, $unk))); $dataTable->filter('ColumnCallbackAddMetadata', array('label', 'country', 'Piwik_UserCountry_getElementFromStringArray', array($separator, 2, $unk))); + + // backwards compatibility: for reports that have lat|long in label $dataTable->filter('ColumnCallbackAddMetadata', - array('label', 'lat', 'Piwik_UserCountry_getElementFromStringArray', array($separator, 3))); + array('label', 'lat', 'Piwik_UserCountry_getElementFromStringArray', array($separator, 3, false))); $dataTable->filter('ColumnCallbackAddMetadata', - array('label', 'long', 'Piwik_UserCountry_getElementFromStringArray', array($separator, 4))); + array('label', 'long', 'Piwik_UserCountry_getElementFromStringArray', array($separator, 4, false))); // add country name & region name metadata $dataTable->filter('MetadataCallbackAddMetadata', diff --git a/plugins/UserCountry/UserCountry.php b/plugins/UserCountry/UserCountry.php index 5cf51e690f..91e6feaf05 100644 --- a/plugins/UserCountry/UserCountry.php +++ b/plugins/UserCountry/UserCountry.php @@ -512,9 +512,9 @@ class Piwik_UserCountry extends Piwik_Plugin $lat = round($lat, Piwik_UserCountry_LocationProvider::GEOGRAPHIC_COORD_PRECISION); $long = round($long, Piwik_UserCountry_LocationProvider::GEOGRAPHIC_COORD_PRECISION); - // append latitude + longitude to label - $newLabel = $label.self::LOCATION_SEPARATOR.$lat.self::LOCATION_SEPARATOR.$long; - $row->setColumn('label', $newLabel); + // set latitude + longitude metadata + $row->setMetadata('lat', $lat); + $row->setMetadata('long', $long); } } } |