Opened 8 years ago

Closed 6 years ago

#17628 closed defect (fixed)

JsonRest : string concatenation of a null query

Reported by: gbranchaud Owned by: dylan
Priority: low Milestone: 1.11
Component: Data Version: 1.9.2
Keywords: Cc:
Blocked By: Blocking:


I had issues with a JsonRest?-backed dgrid where upon sorting, the XHR request would come out as something like:


Of course, I expected something like:


After investigation, I landed upon the query() method of the dojo/store/JsonRest.js file. The issue arises on line 176:

query += (query || hasQuestionMark ? "&" : "?") + (sortParam ? sortParam + '=' : "sort(");

In my case, query is null. So the code basically does null + "?" + "sort("; which results in the leading "null" string.

Since having a null query object at this point is a valid behavior, I think this is a bug in the store implementation.

The proposed fix is simply to add a line in between line 175 & 176 that would initialize query:

query = query || "";

Change History (3)

comment:1 Changed 6 years ago by dylan

Component: RPCData
Milestone: tbd1.11
Owner: set to dylan
Status: newassigned

Will review this soon hopefully.

comment:2 Changed 6 years ago by dylan

Priority: undecidedlow

comment:3 Changed 6 years ago by dylan

Resolution: fixed
Status: assignedclosed

Landed as . Not backporting as it is a subtle change in behavior, even though it's fixing it to be more sane. Thanks gbranchaud!

Note: See TracTickets for help on using tickets.