struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject svn commit: r1240312 - /struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/utils.js
Date Fri, 03 Feb 2012 19:44:51 GMT
Author: jogep
Date: Fri Feb  3 19:44:51 2012
New Revision: 1240312

URL: http://svn.apache.org/viewvc?rev=1240312&view=rev
Log:
WW-3736: Client Validation is broken for Struts2 themes

Modified:
    struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/utils.js

Modified: struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/utils.js
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/utils.js?rev=1240312&r1=1240311&r2=1240312&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/utils.js (original)
+++ struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/utils.js Fri Feb
 3 19:44:51 2012
@@ -24,11 +24,16 @@ var StrutsUtils = {};
 // gets an object with validation errors from string returned by 
 // the ajaxValidation interceptor
 StrutsUtils.getValidationErrors = function(data) {
-  if(data.indexOf("/* {") === 0) {
-    return eval("( " + data.substring(2, data.length - 2) + " )");
-  } else {
-    return null;
-  }  
+    if (typeof data === "object") {
+        return data;
+    }
+    else {
+        if (data.indexOf("/* {") === 0) {
+            return eval("( " + data.substring(2, data.length - 2) + " )");
+        } else {
+            return null;
+        }
+    }
 };
 
 StrutsUtils.clearValidationErrors = function(form) {



Mime
View raw message