Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commit 2288729 breaks existing code #232

Closed
twelveeighty opened this issue Feb 5, 2020 · 5 comments
Closed

Commit 2288729 breaks existing code #232

twelveeighty opened this issue Feb 5, 2020 · 5 comments
Assignees

Comments

@twelveeighty
Copy link
Contributor

After bisecting, I found that commit 2288729 has broken previously working code if used in conjunction with dgrid:

var budgetStore = new Rest({
    idProperty: "budgetId",
    sortParam: "orderBy",
    target: '/rest/budget/'
});
var BudgetGrid = declare([ OnDemandGrid, Selection, ColumnResizer, DijitRegistry ]);
var budgetGrid = new BudgetGrid({
    columns: { ... },
    sort: "project",
    selectionMode: "single",
    cellNavigation: false 
}, dom_id);

// this used to work:
budgetGrid.set("collection", budgetStore.filter({ });

// now it fails with:
_StoreMixin.js:33 TypeError: Cannot read property 'slice' of undefined
    at Object.newLogicalOperator [as and] (Filter.js:42)
    at TMP._renderQueryParams (Request.js:269)
    at TMP._renderUrl (Request.js:282)
    at TMP._request (Request.js:132)
    at TMP.fetchRange (Request.js:108)
    at OnDemandList.js:300
    at OnDemandList.js:186
    at Object._trackError (_StoreMixin.js:466)
    at Object.renderQuery (OnDemandList.js:185)
    at Object.refresh (OnDemandList.js:299)
emitError @ _StoreMixin.js:33

Is there a specific way I need to change the call to budgetStore.filter({ }) for this to work again?

twelveeighty referenced this issue Feb 6, 2020
Combine filter queryLog entries in a manner which obeys order of
precedence
@msssk msssk self-assigned this Feb 6, 2020
@twelveeighty
Copy link
Contributor Author

Update: it's been so long since I had built my code, I had to refresh my memory, but I can confirm that it's definitely the call to Collection.filter( { } ) when passing in an empty object that it fails. In my calling code, there's UI elements that define which filters need to be applied, and if there's none applied, the query object is simply { }.
As a test, I tried calling Collection.filter(), without any object, gives the same error.

I've forked the repo, I'll see if I can come up with a fix myself and submit a pull request, unless someone knows the fix already.

@msssk
Copy link
Contributor

msssk commented Feb 6, 2020

This is the first report of this code causing issues, so if you are able to determine the problem a PR would be welcome!

@twelveeighty
Copy link
Contributor Author

I created a PR with a fix - let me know if you have any concerns.

@twelveeighty
Copy link
Contributor Author

I noticed the pull request was approved, thanks!. When is the merge window/process? Are you pulling this into master?

@msssk
Copy link
Contributor

msssk commented Apr 9, 2020

Fixed in #233 which is merged and will be in the next release.

@msssk msssk closed this as completed Apr 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants