[icinga-checkins] icinga.org: icinga-web/master: * Fixed aliased count fields in legacy api

git at icinga.org git at icinga.org
Thu Aug 25 12:26:29 CEST 2011


Module: icinga-web
Branch: master
Commit: 4f31d2310dfa722d4e0b10e430f3857d5ec9c274
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=4f31d2310dfa722d4e0b10e430f3857d5ec9c274

Author: Jannis Moßhammer <jannis.mosshammer at netways.de>
Date:   Thu Aug 25 11:45:50 2011 +0200

* Fixed aliased count fields in legacy api

---

 .../Store/LegacyLayer/IcingaApiModel.class.php     |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/app/modules/Api/models/Store/LegacyLayer/IcingaApiModel.class.php b/app/modules/Api/models/Store/LegacyLayer/IcingaApiModel.class.php
index ae330fa..8d78efe 100644
--- a/app/modules/Api/models/Store/LegacyLayer/IcingaApiModel.class.php
+++ b/app/modules/Api/models/Store/LegacyLayer/IcingaApiModel.class.php
@@ -124,12 +124,13 @@ class Api_Store_LegacyLayer_IcingaApiModel extends IcingaApiDataStoreModel imple
                 $fields = $this->getFields();
                 $_data = array(array());
                 foreach($fields as $field) {
+                    $field = preg_replace("/\w* +AS +/","",$field);
                     $countField = explode(".",$field,2);
 
                     if (count($countField) > 1) {
                         $countField = $countField[1];
                     }
-
+                    
                     $_data[0]["COUNT_".strtoupper($countField)] = $data;
                     $resultCols[] = "COUNT_".strtoupper($countField);
                 }





More information about the icinga-checkins mailing list