Opened 12 years ago

Closed 11 years ago

Last modified 9 years ago

#5277 closed defect (wontfix)

ItemFileReadStore don't accept empty arrays as attribute values

Reported by: guest Owned by: Jared Jurkiewicz
Priority: high Milestone: 1.2
Component: Data Version: 1.0
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by Jared Jurkiewicz)

DESCRIPTION:

Data source "ItemFileReadStore?" hasAttribute responds false if an attribute exists but its value is an empty array. The behavior seems different in the other data sources.

HOW TO REPRODUCE:

Open http://82.230.65.68:31416/~fred/dojo/fred_samples/bug_016.html Click on the button

RESULT:

A panel that displays "false"

EXPECTED RESULT:

A panel that displays "true", as the "children" attribute is indeed defined in the data source

Change History (6)

comment:1 Changed 12 years ago by bill

Component: GeneralDojoX Data
Owner: changed from anonymous to Jared Jurkiewicz

comment:2 Changed 12 years ago by bill

Component: DojoX DataData

Oops, I guess ItemFileReadStore? is in core. My mistake.

comment:3 Changed 12 years ago by guest

Btw, this comes from the hasAttribute() function in http://trac.dojotoolkit.org/browser/dojo/trunk/data/ItemFileReadStore.js#L120

Don't know what the proper fix should be, thought.

comment:4 Changed 12 years ago by Jared Jurkiewicz

I don't think this is a bug. There is no value for that attribute, so how can it have that attribute? Calling getValue() on it would also return undefined/null.

I'll look a bit further on it, but I'm not sure this is actually a bug.

comment:5 Changed 11 years ago by dylan

Milestone: 1.2

comment:6 Changed 11 years ago by Jared Jurkiewicz

Description: modified (diff)
Resolution: wontfix
Status: newclosed

This is expected behavior of IFRS. Setting a value to an empty array is the same as not having that attribute. It's documented in the code to work that way.

Note: See TracTickets for help on using tickets.