[icinga-checkins] icinga.org: icinga-web/master: Fix template merging when preferPosition Rules exist

git at icinga.org git at icinga.org
Tue Feb 12 18:17:20 CET 2013


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

Author: Jannis Mosshammer <jannis.mosshammer at netways.de>
Date:   Tue Feb 12 15:57:45 2013 +0100

Fix template merging when preferPosition Rules exist

Signed-off-by: Markus Frosch <markus at lazyfrosch.de>

---

 .../template/CronkGridTemplateXmlParser.class.php  |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/app/modules/Cronks/lib/template/CronkGridTemplateXmlParser.class.php b/app/modules/Cronks/lib/template/CronkGridTemplateXmlParser.class.php
index 0ff5240..f23008b 100755
--- a/app/modules/Cronks/lib/template/CronkGridTemplateXmlParser.class.php
+++ b/app/modules/Cronks/lib/template/CronkGridTemplateXmlParser.class.php
@@ -295,17 +295,20 @@ class CronkGridTemplateXmlParser implements Serializable {
             // get index of keys
             
             foreach ($this->fields as $key => $existing) {
-                if ($key != $splitted[1])
-                    $newKeys[$key] = $existing;
-                else {
+                if ($key != $splitted[1]) {
+                    if(!isset($newKeys[$key]))
+                        $newKeys[$key] = $existing;
+                } else {
                     switch ($splitted[0]) {
                         case 'before':
                             $newKeys[$fieldname] = $field;
-                            $newKeys[$key] = $existing;
+                            if(!isset($newKeys[$key]))
+                                $newKeys[$key] = $existing;
                             break;
                         case 'after':
                         default:
-                            $newKeys[$key] = $existing;
+                            if(!isset($newKeys[$key]))
+                                $newKeys[$key] = $existing;
                             $newKeys[$fieldname] = $field;
                     }
                 }





More information about the icinga-checkins mailing list