From d5db604e5fb374b5d79658b56ccb82f23c268ed0 Mon Sep 17 00:00:00 2001
From: satish <satish.dvnk@vtiger.com>
Date: Fri, 21 Oct 2016 17:57:54 +0530
Subject: [PATCH] Mass delete of Orgnization with (????) is deleting all
 records in Orgnizations

---
 resources/Connector.js | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/resources/Connector.js b/resources/Connector.js
index a8bf9bce5..5c5293d16 100644
--- a/resources/Connector.js
+++ b/resources/Connector.js
@@ -49,9 +49,10 @@ var AppConnector = {
 		if(typeof params.data == 'undefined') {
 			if(typeof params == 'string') {
 				var callerParams = params;
-				if(callerParams.indexOf('?')!== -1) {
-					var callerParamsParts = callerParams.split('?')
-					callerParams = callerParamsParts[1];
+				var index = callerParams.indexOf('?');
+				if (index !== -1) {
+					var subStr = callerParams.substr(0, index+1);//need to replace only "index.php?" or "?"
+					callerParams = callerParams.replace(subStr,'');
 				}
 			}else{
 				callerParams = jQuery.extend({}, params);
@@ -61,6 +62,7 @@ var AppConnector = {
 		}
 		//Make the request as post by default
 		if(typeof params.type == 'undefined') params.type = 'POST';
+		if(typeof params.jsonp == 'undefined') params.jsonp = false;
 
 		//By default we expect json from the server
 		if(typeof params.dataType == 'undefined'){
@@ -96,7 +98,6 @@ var AppConnector = {
 			 params.url = 'index.php';
 		}
 
-
 		var success = function(data,status,jqXHR) {
 			aDeferred.resolve(data);
 		}
@@ -104,7 +105,7 @@ var AppConnector = {
 		var error = function(jqXHR, textStatus, errorThrown){
 			aDeferred.reject(textStatus, errorThrown);
 		}
-		
+
 		if(pjaxMode) {
 			if(typeof params.container == 'undefined') params.container = '#pjaxContainer';
 
-- 
GitLab