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

Query: default $entries not available when overwritten by provided $data #5276

Closed
tobimori opened this issue Jun 13, 2023 · 3 comments · Fixed by #5307
Closed

Query: default $entries not available when overwritten by provided $data #5276

tobimori opened this issue Jun 13, 2023 · 3 comments · Fixed by #5307
Assignees
Milestone

Comments

@tobimori
Copy link
Contributor

Description

Since upgrading to v4-alpha.3, my file fields with custom uploads template don't work anymore.

I'm using the following blueprints - it works perfectly fine when removing the uploads.template setting.

label:
  de: Bild
  en: Image
type: files
uploads:
  parent: page('page://assets')
  template: image
multiple: false
image:
  cover: false
text: "{{ file.alt }}"
info: "{{ file.filename }}"
query: site.find('assets').images.filterBy('template', 'image')

CleanShot 2023-06-13 at 12 46 54@2x

Your setup

Kirby Version 4.0.0-alpha.3

@distantnative
Copy link
Member

I think the issue is that page('page://assets') returns null. For me site.page('page://assets') worked. Need to look into why.

@distantnative
Copy link
Member

Ok, it's a Query bug. We pass $page as page to resolve the query, but that clashes with the Query function page. Currently these simply overwrite each other. Which isn't a problem for query entry defaults like kirby because it's of course the same as any kirby we pass to resolve. But in case of page it's page object vs. helper function.

@distantnative distantnative changed the title [v4-alpha.3] File field with custom uploads template fails to load Query: default $entries not available when overwritten by provided $data Jun 18, 2023
@distantnative distantnative modified the milestones: 4.0.0, 3.9.6 Jun 18, 2023
distantnative added a commit that referenced this issue Jun 18, 2023
@distantnative
Copy link
Member

I love it when changes for v4 (like now correctly using upload.parent) uncover unknown bugs from v3.

@distantnative distantnative linked a pull request Jun 18, 2023 that will close this issue
5 tasks
distantnative added a commit that referenced this issue Jun 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants