← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6015: fixed bug in availability system, system was reporting error when server was up (but you were not...

 

------------------------------------------------------------
revno: 6015
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2012-02-17 16:45:02 +0700
message:
  fixed bug in availability system, system was reporting error when server was up (but you were not logged in)
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.availability.js


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.availability.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.availability.js	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.availability.js	2012-02-17 09:45:02 +0000
@@ -51,9 +51,13 @@
             url : "../dhis-web-commons-stream/ping.action",
             cache : false,
             timeout: 10000,
-    		dataType : "json",
+    		dataType : "text",
             success : function( data, textStatus, jqXHR )
             {
+                try {
+                    data = JSON.parse(data);
+                } catch(e) {}
+
                 dhis2.availability._isAvailable = true;
                 var loggedIn = data.loggedIn ? true : false;