PDA

View Full Version : [FIXED] 4.2.* MixedCollection bug.



plleeuwm
13 Jan 2014, 3:03 PM
REQUIRED INFORMATION
Ext version tested:

Ext 4.2.*
The api of MixedCollection add has changed when handling arrays. In Ext 4.0 4.1 and according to the documentation every other major version of Ext the following code behaves differently in 4.2.


var mc = new Ext.util.MixedCollection();
mc.add([1,2]);
mc.getAt(0)
>[1,2]



In 4.2.* this happens:

var mc = new Ext.util.MixedCollection();
mc.add([1,2]);
mc.getAt(0)
>1


As you can see 1 is returned instead of the expected [1,2]. This behavior is not documented in the js docs or in any upgrade guide and in my opinion clearly a bug. Oddly enough this unexpected behavior in add can be obtained by using the addAll method which has existed since 1.1 according to the docs.

Edit

https://fiddle.sencha.com/#fiddle/2lm
(https://fiddle.sencha.com/#fiddle/2lm)
***

This cannot be fixed on our end in an override because Ext has internal classes that rely on this behavior to occur.

Gary Schlosberg
14 Jan 2014, 11:58 AM
Thanks for the report! I have opened a bug in our bug tracker.