[icinga-checkins] icinga.org: icinga-web/master: * Fixed (probably) doctrine bug that binds parameters in pgsql, fixed templates

git at icinga.org git at icinga.org
Tue Apr 24 15:01:14 CEST 2012


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

Author: Jannis Mosshammer <jannis.mosshammer at netways.de>
Date:   Tue Mar  6 16:58:48 2012 +0100

* Fixed (probably) doctrine bug that binds parameters in pgsql, fixed templates

---

 app/modules/Api/config/views/histories.xml         |    8 ++++++--
 app/modules/Api/config/views/service.xml           |   10 +++++-----
 lib/doctrine/lib/Doctrine/Connection/Statement.php |    5 +++++
 3 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/app/modules/Api/config/views/histories.xml b/app/modules/Api/config/views/histories.xml
index 300fc05..26fcff7 100644
--- a/app/modules/Api/config/views/histories.xml
+++ b/app/modules/Api/config/views/histories.xml
@@ -18,7 +18,9 @@
                 hsh.state_time AS STATEHISTORY_STATE_TIME,
                 hsh.output AS STATEHISTORY_OUTPUT,
                 hsh.current_check_attempt AS STATEHISTORY_CURRENT_CHECK_ATTEMPT,
-                hsh.max_check_attempts AS STATEHISTORY_MAX_CHECK_ATTEMPTS
+                hsh.max_check_attempts AS STATEHISTORY_MAX_CHECK_ATTEMPTS,
+                hsh.current_check_attempt AS state_check_attempt,
+                hsh.max_check_attempts AS state_max_check_attempts
             FROM IcingaStatehistory hsh
             INNER JOIN hsh.object oh WITH oh.objecttype_id = 1
             INNER JOIN oh.host h
@@ -74,7 +76,9 @@
                 ssh.state_time AS STATEHISTORY_STATE_TIME,
                 ssh.output AS STATEHISTORY_OUTPUT,
                 ssh.current_check_attempt AS STATEHISTORY_CURRENT_CHECK_ATTEMPT,
-                ssh.max_check_attempts AS STATEHISTORY_MAX_CHECK_ATTEMPTS
+                ssh.max_check_attempts AS STATEHISTORY_MAX_CHECK_ATTEMPTS,
+                ssh.current_check_attempt AS state_check_attempt,
+                ssh.max_check_attempts AS state_max_check_attempts
             FROM IcingaStatehistory ssh
             INNER JOIN ssh.object os WITH os.objecttype_id = 2
             INNER JOIN os.service s
diff --git a/app/modules/Api/config/views/service.xml b/app/modules/Api/config/views/service.xml
index 65ae7d3..f63f535 100644
--- a/app/modules/Api/config/views/service.xml
+++ b/app/modules/Api/config/views/service.xml
@@ -20,7 +20,7 @@
                 ss.last_check AS SERVICE_LAST_CHECK,
                 ss.output AS SERVICE_OUTPUT,
                 ss.current_check_attempt AS SERVICE_CURRENT_CHECK_ATTEMPT,
-                ss.max_check_attempts AS SERVICE_MAX_CHECK_ATTEMPTS,
+                ss.max_check_attempts AS service_max_attempt,
                 i.instance_id AS SERVICE_INSTANCE_ID,
                 s.service_id AS SERVICE_ID,
                 ss.notifications_enabled as notifications_enabled,
@@ -95,14 +95,14 @@
             </filter>
 
             <filter name="hostgroup_name" type="dql">
-                <join>h.hostgroups hg</join>
-                <join>hg.object ohg</join>
+                <innerjoin>h.hostgroups hg</innerjoin>
+                <innerjoin>hg.object ohg</innerjoin>
                 <select>ohg.name1 AS hostgroup_name</select>
             </filter>
 
             <filter name="servicegroup_name" type="dql">
-                <join>s.servicegroups sg</join>
-                <join>sg.object osg</join>
+                <innerjoin>s.servicegroups sg</innerjoin>
+                <innerjoin>sg.object osg</innerjoin>
                 <select>osg.name1 AS servicegroup_name</select>
             </filter>
             
diff --git a/lib/doctrine/lib/Doctrine/Connection/Statement.php b/lib/doctrine/lib/Doctrine/Connection/Statement.php
index ccbec13..5b41858 100644
--- a/lib/doctrine/lib/Doctrine/Connection/Statement.php
+++ b/lib/doctrine/lib/Doctrine/Connection/Statement.php
@@ -244,6 +244,11 @@ class Doctrine_Connection_Statement implements Doctrine_Adapter_Statement_Interf
                 if ($params) {
                     $pos = 0;
                     foreach ($params as $key => $value) {
+
+                        if($value === null) {
+                            continue;
+                        }
+                        
                         $pos++;
                         $param = is_numeric($key) ?  $pos : $key;
                         if (is_resource($value)) {





More information about the icinga-checkins mailing list