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

Fix limit and offset on ordered query builders #5932

Merged
merged 3 commits into from Apr 30, 2022

Conversation

jasonvarga
Copy link
Member

This PR moves the limiting and offsetting from the query to the collection after the results have been retrieved.

For assets/entries/etc fields, the query gets wrapped in a decorator that'll apply the order after the results are retrieved. If you limit/offset, it would have already limited it on the query level before the decorator has a chance to change the order. This made using limit/offset on those types of fields sometimes output things in an unexpected/incorrect order.

@jasonvarga jasonvarga marked this pull request as ready for review April 30, 2022 06:47
@jasonvarga jasonvarga merged commit 590839b into 3.3 Apr 30, 2022
@jasonvarga jasonvarga deleted the fix/ordered-query-builder-limit-offset branch May 2, 2022 02:55
@andershagbard
Copy link
Contributor

Hi @jasonvarga just pinging you here.

I think this commit messed up combining limit and offset.

I had this code, which broke in v3.3.11:

{{ images limit="1" offset="2" }}
  <img src="{{ glide:url width='185' }}">
{{ /images }}

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

Successfully merging this pull request may close these issues.

None yet

2 participants