svn commit: r1686595 - /ofbiz/branches/release12.04/framework/images/webapp/images/selectall.js

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1686595 - /ofbiz/branches/release12.04/framework/images/webapp/images/selectall.js

nmalin
Author: nmalin
Date: Sat Jun 20 12:14:02 2015
New Revision: 1686595

URL: http://svn.apache.org/r1686595
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/branches/release12.04/framework/images/webapp/images/selectall.js

Modified: ofbiz/branches/release12.04/framework/images/webapp/images/selectall.js
URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/framework/images/webapp/images/selectall.js?rev=1686595&r1=1686594&r2=1686595&view=diff
==============================================================================
--- ofbiz/branches/release12.04/framework/images/webapp/images/selectall.js (original)
+++ ofbiz/branches/release12.04/framework/images/webapp/images/selectall.js Sat Jun 20 12:14:02 2015
@@ -259,7 +259,9 @@ function ajaxUpdateArea(areaId, target,
 */
 function ajaxUpdateAreas(areaCsvString) {
     waitSpinnerShow();
-    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];
@@ -947,4 +949,4 @@ function showErrorAlert(errBoxTitle, err
             }
         });
     }
-}
\ No newline at end of file
+}