SPCascadeDropdowns issue with ampersand

Nov 30, 2010 at 9:11 PM

There is a current issue with the SPCascadeDropdowns function in how it builds the CAML query for multiselect lookup fields.  When the lookup value contains an ampersand i.e. "Office Products & Services" the ampersand is encoded to "&".  It should be encoded to "&".  As a temporary fix to correct the issue I removed the calls to the escapeColumnValue function in the non minified script:  

		// Build up the criteria for inclusion
		if(parentSelectSelected.length == 0) 
		{
			// Handle the case where no values are selected in multi-selects
			camlQuery += "<Eq><FieldRef Name='" + opt.relationshipListParentColumn + "'/><Value Type='Text'></Value></Eq>";
		} 
		else if(parentSelectSelected.length == 1) 
		{
			// Only one value is selected
			camlQuery += "<Eq><FieldRef Name='" + opt.relationshipListParentColumn + "'/><Value Type='Text'>" + parentSelectSelected[0] + "</Value></Eq>";
		} 
		else 
		{
			var compound = (parentSelectSelected.length > 2) ? true : false;
			for(i=0;i < (parentSelectSelected.length - 1);i++) {
				camlQuery += "<Or>";
			}
			for(i=0;i < parentSelectSelected.length;i++) {
				camlQuery += "<Eq><FieldRef Name='" + opt.relationshipListParentColumn + "'/><Value Type='Text'>" + parentSelectSelected[i] + "</Value></Eq>";
				if(i>0 && (i < (parentSelectSelected.length - 1)) && compound) camlQuery += "</Or>";
			}
			camlQuery += "</Or>";
		}