[fusion-commits] r2426 - in trunk/layers/MapGuide: . php

svn_fusion at osgeo.org svn_fusion at osgeo.org
Thu Sep 1 01:51:57 EDT 2011


Author: jng
Date: 2011-08-31 22:51:57 -0700 (Wed, 31 Aug 2011)
New Revision: 2426

Modified:
   trunk/layers/MapGuide/MapGuide.js
   trunk/layers/MapGuide/php/CreateSession.php
Log:
#474: Ensure that the create session process is properly reporting any JSONififed errors returned by CreateSession.php. Update CreateSession.php to not write out any redundant error information (that would render the already written JSON error response invalid)

Modified: trunk/layers/MapGuide/MapGuide.js
===================================================================
--- trunk/layers/MapGuide/MapGuide.js	2011-08-29 05:55:25 UTC (rev 2425)
+++ trunk/layers/MapGuide/MapGuide.js	2011-09-01 05:51:57 UTC (rev 2426)
@@ -138,15 +138,19 @@
         if (xhr.status == 200) {
             var o;
             eval('o='+xhr.responseText);
-            this.session[0] = o.sessionId;
-            var acceptLang = o.acceptLanguage.split(',');
-            //IE - en-ca,en-us;q=0.8,fr;q=0.5,fr-ca;q=0.3
-            for (var i=0; i<acceptLang.length; ++i) {
-              var locale = acceptLang[i].split(";");
-              Fusion.initializeLocale(locale[0]);
-              break;
+            if (o.success === false) {
+                Fusion.reportError(o.message);
+            } else {
+                this.session[0] = o.sessionId;
+                var acceptLang = o.acceptLanguage.split(',');
+                //IE - en-ca,en-us;q=0.8,fr;q=0.5,fr-ca;q=0.3
+                for (var i=0; i<acceptLang.length; ++i) {
+                  var locale = acceptLang[i].split(";");
+                  Fusion.initializeLocale(locale[0]);
+                  break;
+                }
+                this.triggerEvent(Fusion.Event.MAP_SESSION_CREATED);
             }
-            this.triggerEvent(Fusion.Event.MAP_SESSION_CREATED);
         }
     },
 

Modified: trunk/layers/MapGuide/php/CreateSession.php
===================================================================
--- trunk/layers/MapGuide/php/CreateSession.php	2011-08-29 05:55:25 UTC (rev 2425)
+++ trunk/layers/MapGuide/php/CreateSession.php	2011-09-01 05:51:57 UTC (rev 2426)
@@ -31,7 +31,8 @@
 include('Common.php');
 if(InitializationErrorOccurred())
 {
-    DisplayInitializationErrorText();
+    //If initialization error occurred, then the error JSON has already been written
+    //so just exit.
     exit;
 }
 include('Utilities.php');



More information about the fusion-commits mailing list