Opened 8 years ago

Closed 8 years ago

#13416 closed enhancement (fixed)

[patch] [cla] dojox.data.XmlStore doesn't return any results when passing a RegExp in the query arguments

Reported by: William Riley Owned by: Jared Jurkiewicz
Priority: high Milestone: 1.7
Component: DojoX Data Version: 1.7.0b1
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

When passing a RegExp in the query for a dojox.data.XmlStore like this:

myStore.fetch({
    query: {name: /^.*$/m},
    onComplete: function(e){ console.log(e); }
});

onComplete gets an empty array, even though the above regex is equivalent to passing "*" in it's place.

I have a patch that fixes this, and I've signed a CLA under the name "William Riley."

Attachments (1)

xmlStoreFix.diff (501 bytes) - added by William Riley 8 years ago.
Fix for passing RegExp? as a query argument

Download all attachments as: .zip

Change History (11)

Changed 8 years ago by William Riley

Attachment: xmlStoreFix.diff added

Fix for passing RegExp? as a query argument

comment:1 Changed 8 years ago by Jared Jurkiewicz

Milestone: tbdfuture

comment:2 Changed 8 years ago by Jared Jurkiewicz

Have you signed a CLA?

comment:3 Changed 8 years ago by bill

Description: modified (diff)
Summary: dojox.data.XmlStore doesn't return any results when passing a RegExp in the query arguments[patch] [cla] dojox.data.XmlStore doesn't return any results when passing a RegExp in the query arguments
Type: defectenhancement

Presumably this is an enhancement request? AFAIK none of the dojo.data API stores accept a regex as a search string. It is common w/the new dojo.store API, like for dojo.store.Memory.

BTW the initial description mentions the CLA.

comment:4 in reply to:  3 Changed 8 years ago by William Riley

Replying to bill:

Presumably this is an enhancement request? AFAIK none of the dojo.data API stores accept a regex as a search string. It is common w/the new dojo.store API, like for dojo.store.Memory.

I found that RegExp? objects were being passed as query args when I was using them with the FilteringSelect? widget.

comment:5 Changed 8 years ago by bill

Oh... OK yah I changed it to a regex for talking to the new dojo.store API, it worked with old stores like dojo.data.ItemFileReadStore because the regex had a toString() method, but apparently doesn't work with dojox.data.XmlStore.

comment:6 Changed 8 years ago by bill

I'll switch ComboBox back so it passes in a string rather than a regex when talking to a store with the old dojo.data API. Seems better for backwards compatibility.

Not sure if you still want to apply this enhancement to XmlStore? or not. You could apply it now, or just wait until XmlStore is converted to the new dojo.store API and do it then.

comment:7 Changed 8 years ago by William Riley

As long as the backwards compatibility is fixed, I don't really mind either way. It's only two lines of code though, so it's not like it's a major change.

comment:8 Changed 8 years ago by bill

(In [25771]) Switch ComboBox? back so it passes in a string rather than a regex when talking to a store with the old dojo.data API. Seems better for backwards compatibility.

Refs #12373, #13416, #13880 !strict.

comment:9 Changed 8 years ago by Jared Jurkiewicz

Fixed in [25949]

comment:10 Changed 8 years ago by Jared Jurkiewicz

Milestone: future1.7
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.