Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Support

Bug with multiple upload fields

Started by Pascal 8 years ago · 3 replies · 627 views
8 years ago

Hi guys! I am currently working on a portfolio site that includes quite a lot of file uploading through the admin plugin. I now came across a strange error. I am using a list to upload files along with some attributes. This is the code in my template YAML:

YAML
        header.entries:
          name: images
          type: list
          label: Bilder
          collapsed: 'true'

          fields:
            .images:
              type: file
              label: Images
              destination: 'self@'
              accept:
               - 'image/*'
              multiple: true
            .layout:
              type: select
              size: short
              label: Größe der Bilder
              options:
               full: 100%
               twothirds: 66%
               onethird: 33%
               doubleheight: 33% (doppelte Höhe)
            .slideshow:
              type: toggle
              options:
               1: PLUGIN_ADMIN.YES
               0: PLUGIN_ADMIN.NO
              default: 0
              label: "Mehrere Bilder als Slideshow zusammenfassen"
            .onfront:
              type: toggle
              options:
               1: PLUGIN_ADMIN.YES
               0: PLUGIN_ADMIN.NO
              default: 1
              label: "Bilder in der Übersicht anzeigen"
            .backgroundcolor:
                type: colorpicker
                label: Hintergrundfarbe
                placeholder: '#00000'
            .backgroundblur:
              type: toggle
              options:
               1: PLUGIN_ADMIN.YES
               0: PLUGIN_ADMIN.NO
              default: 0
              label: "Background Blur"
            .coverimage:
              type: toggle
              options:
               1: PLUGIN_ADMIN.YES
               0: PLUGIN_ADMIN.NO
              default: 0
              label: "In der Übersicht zuerst anzeigen"

My problem is, that whenever I have multiple image upload fields on the page, delete an image from one of them and save the page, all other images disappear and every image upload field is populated by the image in the first of my fields.

Before: https://ibb.co/kQ2SX7
After deleting an image from one field and saving: https://ibb.co/gpoO5S

Does anyone have an idea what might cause this bug?

Cheers
Pascal

👍 1
8 years ago

I think yours is different. It is standard behaviour. As far as I understand the field "Page Media" is meant to list all media that is part of a page, no matter from which field it has been uploaded.

Suggested topics

Topic Participants Replies Views Activity
Support · by Thomas, 1 week ago
2 60 16 hours ago
Support · by Anna, 3 days ago
2 66 19 hours ago
Support · by Justin Young, 20 hours ago
1 34 20 hours ago
Support · by Duc , 1 week ago
2 70 6 days ago
Support · by Colin Hume, 1 week ago
2 61 6 days ago