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 overwriting of Query::$entries #5307

Merged
merged 2 commits into from
Jun 19, 2023
Merged

Conversation

distantnative
Copy link
Member

@distantnative distantnative commented Jun 18, 2023

This PR …

For most queries, we pass along a few objects (kirby, site as well as file, page etc.). However, in doing so, we would overwrite the default entry helpers, such as page() or file().

This PR fixes it by:

  • still given the data precedence that was passed along
  • but falling back to the entry helpers if
    • no matching data was passed along
    • the matching data doesn't fit to the query (e.g. it's an object, but query tries to call it with arguments)

It also backports a fix from v4 regarding integer/float arguments. This commit could be skipped in the review.

Fixes

Ready?

  • Unit tests for fixed bug/feature
  • In-code documentation (wherever needed)
  • Tests and checks all pass

For review team

@distantnative distantnative added this to the 3.9.6 milestone Jun 18, 2023
@distantnative distantnative self-assigned this Jun 18, 2023
@distantnative distantnative requested a review from a team June 18, 2023 16:52
@distantnative distantnative force-pushed the fix/5276-query-entries branch from 7acfe88 to 80fd73c Compare June 18, 2023 16:55
@bastianallgeier bastianallgeier merged commit e0e56ed into develop Jun 19, 2023
@bastianallgeier bastianallgeier deleted the fix/5276-query-entries branch June 19, 2023 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Query: default $entries not available when overwritten by provided $data
2 participants