PDA

View Full Version : [CLOSED] JsonP bug in destroy function



hakana
3 Nov 2011, 4:15 AM
REQUIRED INFORMATION

Ext version tested:

Ext 4.0.7

Browser versions tested against:

IE8
FF7

Description:

Ext.data.proxy.JsonP destroy function is not passing arguments to callParent.

Steps to reproduce the problem:

Model.destroy() using the jsonP proxy

The result that was expected:

Send destroy request to server

The result that occurs instead:

Exception: operation is undefined

HELPFUL INFORMATION

Debugging already done:

yes

Possible fix:

Current code:


//inherit docs
destroy: function() {
this.abort();
this.callParent();
},


Fixed code:


//inherit docs
destroy: function() {
this.abort();
this.callParent(arguments);
},

evant
3 Nov 2011, 4:23 PM
This bug is already fixed in the 4.1 branch, thanks for the report.

gjsmith66
21 Mar 2012, 2:03 PM
How can we get this addressed in the 4.0 branch? We have live applications that will not work due to this bug, and it appears that 4.1 is a ways off. This would appear to be a significant bug, currently it is impossible to use the jsonp proxy, this stops us cold.

Thanks

LesJ
22 Mar 2012, 2:33 AM
How can we get this addressed in the 4.0 branch? We have live applications that will not work due to this bug, and it appears that 4.1 is a ways off. This would appear to be a significant bug, currently it is impossible to use the jsonp proxy, this stops us cold.

Thanks

This would be very easy to override.

For the sake of better documentation there should be some indication that there can be variable args.

Looking at the code it appears there's no need to include arguments in the callParent call.


destroy: function(var_args) {
this.abort();
this.callParent(arguments);
},


See how Google adds such docs.


/**
* Extends an array with another array, element, or "array like" object.
* This function operates 'in-place', it does not create a new Array.
*
* Example:
* var a = [];
* goog.array.extend(a, [0, 1]);
* a; // [0, 1]
* goog.array.extend(a, 2);
* a; // [0, 1, 2]
*
* @param {Array} arr1 The array to modify.
* @param {*} var_args The elements or arrays of elements to add to arr1.
*/
goog.array.extend = function(arr1, var_args) {
for (var i = 1; i < arguments.length; i++) {
var arr2 = arguments[i];
if (goog.isArrayLike(arr2)) {
// Make sure arr2 is a real array, and not just "array like."
arr2 = goog.array.toArray(arr2);
arr1.push.apply(arr1, arr2);
} else {
arr1.push(arr2);
}
}
};