Author:   Lars Michelsen <[email protected]>
Date:     Sun Nov 27 00:59:04 2011 +0100
Committer:   Lars Michelsen <[email protected]>
Commit-Date: Sun Nov 27 00:59:04 2011 +0100

Bugfix: Not terminating map rename when one map contains a syntax error

---

 ChangeLog                                |    1 +
 share/server/core/classes/CoreModMap.php |   24 ++++++++++++++----------
 2 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index db3e578..753761c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -28,6 +28,7 @@ Frontend
   * Bugfix: Don't enable map_image when not set when editing the global
     sections of maps
   * Bugfix: Removing just dragged new lines before opening the add/modify 
dialog
+  * Bugfix: Not terminating map rename when one map contains a syntax error
 
 1.6rc4
 Core
diff --git a/share/server/core/classes/CoreModMap.php 
b/share/server/core/classes/CoreModMap.php
index 46cf168..a44e1b1 100644
--- a/share/server/core/classes/CoreModMap.php
+++ b/share/server/core/classes/CoreModMap.php
@@ -775,18 +775,22 @@ class CoreModMap extends CoreModule {
 
         // loop all map configs to replace mapname in all map configs
         foreach($this->CORE->getAvailableMaps() as $mapName) {
-            $MAPCFG1 = new GlobalMapCfg($this->CORE, $mapName);
-            $MAPCFG1->readMapConfig();
+            try {
+                $MAPCFG1 = new GlobalMapCfg($this->CORE, $mapName);
+                $MAPCFG1->readMapConfig();
 
-            $i = 0;
-            // loop definitions of type map
-            foreach($MAPCFG1->getDefinitions('map') AS $key => $obj) {
-                // check if old map name is linked...
-                if($obj['map_name'] == $a['map']) {
-                    $MAPCFG1->setValue('map', $i, 'map_name', 
$a['map_new_name']);
-                    $MAPCFG1->writeElement('map',$i);
+                $i = 0;
+                // loop definitions of type map
+                foreach($MAPCFG1->getDefinitions('map') AS $key => $obj) {
+                    // check if old map name is linked...
+                    if($obj['map_name'] == $a['map']) {
+                        $MAPCFG1->setValue('map', $i, 'map_name', 
$a['map_new_name']);
+                        $MAPCFG1->writeElement('map',$i);
+                    }
+                    $i++;
                 }
-                $i++;
+            } catch(Exception $e) {
+                // Do nothing. Siletly pass config errors here...
             }
         }
 


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to