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

sort and where liquid filters stopped working #16922

Closed
MichaelPetrinolis opened this issue Oct 23, 2024 · 6 comments
Closed

sort and where liquid filters stopped working #16922

MichaelPetrinolis opened this issue Oct 23, 2024 · 6 comments

Comments

@MichaelPetrinolis
Copy link
Contributor

MichaelPetrinolis commented Oct 23, 2024

Describe the bug

After upgrading to OrchardCore 2 (STJ) the where and sort filters stopped working

{% assign hotActions = articleListItems
| where: "Content.HotActionsPart.AddtoHotActionsMenu.Value", true
| sort: "Content.HotActionsPart.Order.Value" %}

the above code used to work in OC 1.8

Orchard Core version

2.0.2

To Reproduce

create a liquid template and try filtering and sorting

Expected behavior

The array should contain the filtered elements, sorted

@sebastienros
Copy link
Member

@MichaelPetrinolis what is the easiest way to repro? A shape template, a query? With a Boolean Field?

@sebastienros sebastienros added this to the 2.x milestone Oct 24, 2024
Copy link
Contributor

We triaged this issue and set the milestone according to the priority we think is appropriate (see the docs on how we triage and prioritize issues).

This indicates when the core team may start working on it. However, if you'd like to contribute, we'd warmly welcome you to do that anytime. See our guide on contributions here.

@sebastienros sebastienros modified the milestones: 2.x, 2.1 Oct 24, 2024
Copy link
Contributor

We triaged this issue and set the milestone according to the priority we think is appropriate (see the docs on how we triage and prioritize issues).

This indicates when the core team may start working on it. However, if you'd like to contribute, we'd warmly welcome you to do that anytime. See our guide on contributions here.

@MichaelPetrinolis
Copy link
Contributor Author

MichaelPetrinolis commented Oct 24, 2024

@MichaelPetrinolis what is the easiest way to repro? A shape template, a query? With a Boolean Field?

@sebastienros yes,a content item with a part that has two fields, one boolean and one numeric. We used the numeric for sorting and the bool for filtering. Also the items come from a query inside a liquid template for a shape.

@MichaelPetrinolis
Copy link
Contributor Author

@sebastienros I added some tests that reproduce the bug with 'sort' and 'where' liquid filters

@sebastienros
Copy link
Member

So the issue looks like ordering on deserialized json. With all the automatic type conversion that was added since the switch it makes me a little sad. But the test will help a lot, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants