Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#574 closed defect (fixed)

dojo.io.checkChildrenForFile evaluates length.getAttribute - is not a function

Reported by: s.milek@… Owned by: anonymous
Priority: high Milestone:
Component: Core Version: 0.3
Keywords: Cc: jeoffwilks@…
Blocked By: Blocking:

Description

Using dojo.io.bind with a formNode, I get an exception in dojo.io.checkChildrenForFile (BrowserIO.js line 15 / trunk HEAD) :

"input.getAttribute is not a function"

this is because the result of the call on line 12 of BrowserIO.js:

var inputs = node.getElementsByTagName("input");

'inputs' does not evaluate to an Array according the dojo.lang.isArray, which is called in dojo.lang.forEach

this eventually causes inputs.length.getAttribute() to be attempted

in Venkman, 'inputs' is an HTMLCollection object (FF1.5 WinXP)

based on the svn log for lang/common.js, dojo.lang.forEach was modified a couple of times each by 2 different developers on 03-24. This may be part of it. I do not know if this was a problem prior to now, because I just created this case.

Also, the form is created via ContentPane?.setContent, which uses innerHTML. I'm mentioning this because I'm imagining that the node-tree created via setting innerHTML may have peculiarities about it that cause the error in my case but not in the normal case (where the content is not set with innerHTML).

Thanks.

Attachments (1)

ticket_574_isArrayLike.patch (441 bytes) - added by jeoffwilks@… 13 years ago.
as suggested in first comment

Download all attachments as: .zip

Change History (9)

comment:1 Changed 13 years ago by anonymous

should dojo.lang.forEach be calling dojo.lang.isArrayLike instead of isArray?

comment:2 Changed 13 years ago by s.milek@…

Component: GeneralCore
Version: 0.20.3

comment:3 Changed 13 years ago by jeoffwilks@…

Cc: jeoffwilks@… added
severity: normalblocker

I hit this same bug when trying to migrate from 0.2.2 to trunk in order to gain other features.

Blocks use of "formNode" in dojo.io.bind().

It seems to work for me when I change dojo.lang.forEach to test for isArrayLike in place of isArray, as suggested above.

Changed 13 years ago by jeoffwilks@…

as suggested in first comment

comment:4 Changed 13 years ago by James Burke

Resolution: fixed
Status: newclosed

This appears to be fixed after the latest changes to dojo.lang.forEach (just checked in later today). I just tried with test_IframeIO.html with the latest from SVN, and I did not get any errors.

comment:5 Changed 13 years ago by alex

does this still work? It looks like sjmiles rolled back his patch to forEach. We should retest.

comment:6 Changed 13 years ago by alex

Milestone: 0.3release

comment:7 Changed 13 years ago by anonymous

It was fixed by [3398]. It looks like some tests were added in [3399].

FYI: tying tickets to changesets is a lot easier if you use Trac's post-commit hook script with Subversion:

comment:8 Changed 12 years ago by (none)

Milestone: 0.3release

Milestone 0.3release deleted

Note: See TracTickets for help on using tickets.