You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by nm...@apache.org on 2015/06/20 14:13:13 UTC

svn commit: r1686593 - /ofbiz/trunk/framework/images/webapp/images/selectall.js

Author: nmalin
Date: Sat Jun 20 12:13:13 2015
New Revision: 1686593

URL: http://svn.apache.org/r1686593
Log:
error in parsing array in ajaxUpdateAreas, use a regexp tp split all parameters separate by comma and support this string a,{b,c,d},e as three parameters and not five. Patch related to OFBIZ-6496. Thanks Pierre Gaudin for this issue.

Modified:
    ofbiz/trunk/framework/images/webapp/images/selectall.js

Modified: ofbiz/trunk/framework/images/webapp/images/selectall.js
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/selectall.js?rev=1686593&r1=1686592&r2=1686593&view=diff
==============================================================================
--- ofbiz/trunk/framework/images/webapp/images/selectall.js (original)
+++ ofbiz/trunk/framework/images/webapp/images/selectall.js Sat Jun 20 12:13:13 2015
@@ -263,7 +263,9 @@ function ajaxUpdateArea(areaId, target,
   * form of: areaId, target, target parameters [, areaId, target, target parameters...].
 */
 function ajaxUpdateAreas(areaCsvString) {
-    var areaArray = areaCsvString.split(",");
+    /*split all parameters separate by comma, the regExp manage areaId,target,param1=a&param2={b,c,d}&param3=e as three parameters*/
+    var regExpArea = /,(?=(?:[^{}]*{[^{}]*})*[^{}]*$)/g; 
+    var areaArray = areaCsvString.split(regExpArea);
     var numAreas = parseInt(areaArray.length / 3);
     for (var i = 0; i < numAreas * 3; i = i + 3) {
         var areaId = areaArray[i];