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

Optional input parameter for file update #8

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

thomasjonas
Copy link
Contributor

Should fix #7 Maybe parameters for functions should also be optional, but I'm not sure if they cause any problems.

@afbora
Copy link
Owner

afbora commented Aug 10, 2023

I need to check again. Because seems that's correct according to the document:
https://getkirby.com/docs/reference/plugins/hooks/file-update-before

@thomasjonas
Copy link
Contributor Author

thomasjonas commented Aug 10, 2023

Yeah, I saw that as well. So I was a bit surprised. Maybe it has something to do with the fact I'm using a custom file blueprint.

Page blueprint

title: Default

fields:
  content:
    type: layout
    fieldsets:
      gallery:
        name: Sponsors
        icon: money
        preview: gallery
        fields:
          images:
            label: Sponsors
            type: files
            query: model.images
            multiple: true
            layout: cards
            size: tiny
            empty: No sponsors yet
            uploads:
              template: sponsor
            image:
              ratio: 1/1

/site/blueprints/files/sponsor.yml

title: Sponsor image

fields:
  link:
    type: url
  alt:
    label: Alternative Text
    type: text

accept:
  mime: image/*
  type: image

@thomasjonas
Copy link
Contributor Author

Any chance of reproducing the problem?

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.

TypeError when updating a file
2 participants