parent option bug in 3.1, Critical
Reported by aek | November 21st, 2011 @ 05:27 PM | in 3.1 (closed)
I found a bug in Jxlib 3.1b2 introduced by a change in
mootools-core Class.
The parent option is used in Jxlib widgets to get the domObj added
to the parent if there is an option parent specified. The parent
option is only check for exist and now mootools add this option for
us when calling to initialize method of the Class.
This is the line that do the trick at line 3224 of
mootools-core.js version: 1.4.1
var value = (this.initialize) ? this.initialize.apply(this,
arguments) : this;
The parent option get added as a function because it' is part of the prototype of the class. It's defined as part of the prototype of the class at line 3231 of mootools-core.js version: 1.4.1 and the function parent is defined at line 3236
I think that Jxlib need to change the option property used to identify the parent to be added to. Could be 'idParent' or 'parentId' or whatever name that do not enter in conflict with mootools.
I discover this using a grid example, the options of the grid had a property parent that I don't put in there
Comments and changes to this ticket
-

Jon Bomgardner November 21st, 2011 @ 06:48 PM
- → Assigned user set to Jon Bomgardner
aek,
Does this actually break anything in JxLib? The fact that parent is added to the class itself is not an issue as it is needed to call the previous version of functions (we use it all the time in classes). We use the parent option in this.options.parent which is not the same as this.parent which is a function.
-

aek November 21st, 2011 @ 08:35 PM
The problem is with this.options.parent which is a function when it's asked for if has a value to call addTo to get added to the parent reference. To solve this problem instead of changing the name of the parent property in the options this could be done:
if (this.options.parent !== undefined && this.options.parent !== null && Jx.type(this.options.parent) !== 'function') {
}
when jxlib want to add the widget instance to the parent reference. Mootools do not override the user supplied options so if the user provide a parent option for a widget works as normal
-

Jon Bomgardner November 21st, 2011 @ 09:12 PM
- → State changed from new to resolved
(from [a301212d5326cae53ed82ff4a1f321b3f800100a]) Merge pull request #58 from jonlb/issue-60
fix for issue 60 [#60 state:resolved]
https://github.com/JxLib/JxLib/commit/a301212d5326cae53ed82ff4a1f32... -

Jon Bomgardner November 21st, 2011 @ 09:12 PM
(from [92ca0577be8a8d967f05215f340e30ae2b01a0ef]) fix for issue 60 [#60 state:resolved] https://github.com/JxLib/JxLib/commit/92ca0577be8a8d967f05215f340e3...
-

aek November 21st, 2011 @ 09:23 PM
you made changes only in Jx.Widget but I think that changes need to be done wherever the options.parent property is used and it's used a lot
-

Jon Bomgardner November 21st, 2011 @ 09:33 PM
- → Milestone set to 3.1
- → State changed from resolved to re-opened
I'm in the process of making sure the only place options.parent is used is in the Jx.Widget base class. I'll do a quick search of the codebase and see if I find it anywhere else.
Jon
-

aek November 21st, 2011 @ 09:50 PM
you can use the build version of jxlib.standalone.uncompressed.js to search for
-

Jon Bomgardner November 21st, 2011 @ 11:38 PM
- → State changed from re-opened to started
My IDE also has the ability to search all of the files ina project. I should have this finished up tonight or tomorrow sometime.
Jon
-

Jon Bomgardner November 25th, 2011 @ 03:59 PM
(from [19a132613f8fd4d9a5f1ea66bea3f2295622fd15]) various fixes including issue #60 [#60 status:resolved] https://github.com/JxLib/JxLib/commit/19a132613f8fd4d9a5f1ea66bea3f...
-

Jon Bomgardner November 25th, 2011 @ 03:59 PM
(from [3b341482c878318a340f2f0ac19fa281199556b5]) Merge pull request #62 from jonlb/fixes
various fixes including issue #60 [#60 status:resolved]
https://github.com/JxLib/JxLib/commit/3b341482c878318a340f2f0ac19fa... -

Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »