agarberi
1 Oct 2014, 8:58 AM
Ext version tested:
Ext 5.0.2 rev 1381 (Nightly 2014-09-21)
Browser versions tested against:
Chrome 37
DOCTYPE tested against:
<!DOCTYPE html>
Description:
When you clone a phantom record using "debug" libs (eg: "ext-debug.js"), you get an Exception if the Model has a convert function that returns "null" for the ID field
Ext.data.Model.constructor() throws an Exception because the record being copied contains an ID
See code below for the code that throws the exception
//<debug>
if (dataId) {
Ext.Error.raise('The model ID configured in data ("' + dataId + '") has been rejected by the ' + me.fieldsMap.type + ' field converter for the ' + idProperty + ' field');
}
//</debug>
Steps to reproduce the problem:
Load a debug version of Ext JS 5.0.2 (for example "ext-debug.js")
Define a Model with a converter for ID field that returns null (at least for new records)
Create a new record of the defined Model
Clone it with "record.clone()"
The result that was expected:
The record is cloned as a new phantom record
The result that occurs instead:
An exception is thrown (eg: [I]'The model ID configured in data ("MyModel-1") has been rejected by the auto field converter for the id field')
Note: the Fiddle does not show the bug because it is not a "debug" build.
Is there a way to load a "debug" build with Fiddle? The file that Fiddle loads is called "ext-all-debug.js", but it has no debug code inside!
b6f
Ext 5.0.2 rev 1381 (Nightly 2014-09-21)
Browser versions tested against:
Chrome 37
DOCTYPE tested against:
<!DOCTYPE html>
Description:
When you clone a phantom record using "debug" libs (eg: "ext-debug.js"), you get an Exception if the Model has a convert function that returns "null" for the ID field
Ext.data.Model.constructor() throws an Exception because the record being copied contains an ID
See code below for the code that throws the exception
//<debug>
if (dataId) {
Ext.Error.raise('The model ID configured in data ("' + dataId + '") has been rejected by the ' + me.fieldsMap.type + ' field converter for the ' + idProperty + ' field');
}
//</debug>
Steps to reproduce the problem:
Load a debug version of Ext JS 5.0.2 (for example "ext-debug.js")
Define a Model with a converter for ID field that returns null (at least for new records)
Create a new record of the defined Model
Clone it with "record.clone()"
The result that was expected:
The record is cloned as a new phantom record
The result that occurs instead:
An exception is thrown (eg: [I]'The model ID configured in data ("MyModel-1") has been rejected by the auto field converter for the id field')
Note: the Fiddle does not show the bug because it is not a "debug" build.
Is there a way to load a "debug" build with Fiddle? The file that Fiddle loads is called "ext-all-debug.js", but it has no debug code inside!
b6f