[icinga-checkins] icinga.org: icinga-web/mhein/testing: * Added failure fallback for IcingaStoreTargetModifier w/o columns given

git at icinga.org git at icinga.org
Thu Aug 11 17:55:53 CEST 2011


Module: icinga-web
Branch: mhein/testing
Commit: 0b9e08e328e30bfe0cc4cf378968c2024dda5572
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=0b9e08e328e30bfe0cc4cf378968c2024dda5572

Author: Jannis Mosshammer <jannis.mosshammer at netways.de>
Date:   Thu Aug 11 17:31:27 2011 +0200

* Added failure fallback for IcingaStoreTargetModifier w/o columns given

---

 .../IcingaStoreTargetModifierModel.class.php       |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/app/modules/Api/lib/datastore/IcingaStoreTargetModifierModel.class.php b/app/modules/Api/lib/datastore/IcingaStoreTargetModifierModel.class.php
index 3cf3ffc..a1f423f 100755
--- a/app/modules/Api/lib/datastore/IcingaStoreTargetModifierModel.class.php
+++ b/app/modules/Api/lib/datastore/IcingaStoreTargetModifierModel.class.php
@@ -195,8 +195,10 @@ class IcingaStoreTargetModifierModel extends IcingaBaseModel implements IDataSto
     public function setFields($fields, $useColumnAlias = false) {
         if(!is_array($fields))
             $fields = array($fields);
-        
+       
         foreach($fields as $field) { 
+            if(!$field)
+                continue;
             $aliasField = "";
             if($useColumnAlias && isset($this->columns[$field])) {
                 $aliasField = $field; 
@@ -206,6 +208,7 @@ class IcingaStoreTargetModifierModel extends IcingaBaseModel implements IDataSto
             $regExp = "/(?<alias>\w+)\.(?<field>\w+)/";
             $match = array();
             preg_match($regExp,$field,$match);
+            
             if(!isset($match["alias"])) {
                 if($field[0] != '(')
                     $field = $this->mainAlias.".".$field;  





More information about the icinga-checkins mailing list