Author: pranayp
Date: Sat Jul 22 13:06:12 2017
New Revision: 1802690
URL:
http://svn.apache.org/viewvc?rev=1802690&view=revLog:
Fixed: Adding condition in price rule on 'Role Type' showing incorrect result.
(OFBIZ-7275)
The issue exists because in role type list there are multiple occurrences of substring "CUSTOMER". The existing check was just checking the occurrence of a substring in the string and found this value more than once in the list so the last option gets selected. Applied equality check to find the exact match.
Thanks Aditi Patidar for reporting and providing the patch.
Modified:
ofbiz/ofbiz-framework/trunk/framework/images/webapp/images/miscAjaxFunctions.js
Modified: ofbiz/ofbiz-framework/trunk/framework/images/webapp/images/miscAjaxFunctions.js
URL:
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/images/webapp/images/miscAjaxFunctions.js?rev=1802690&r1=1802689&r2=1802690&view=diff==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/images/webapp/images/miscAjaxFunctions.js (original)
+++ ofbiz/ofbiz-framework/trunk/framework/images/webapp/images/miscAjaxFunctions.js Sat Jul 22 13:06:12 2017
@@ -62,7 +62,7 @@ function getDependentDropdownValues(requ
jQuery.each(list, function(key, value){
if (typeof value == 'string') {
values = value.split(': ');
- if (values[1].indexOf(selected) >= 0 && selected.length > 0) {
+ if (values[1].indexOf(selected) >= 0 && selected.length > 0 && selected == values[1]) {
optionList += "<option selected='selected' value = " + values[1] + " >" + values[0] + "</option>";
} else {
optionList += "<option value = " + values[1] + " >" + values[0] + "</option>";