Grav-plugin-admin: Folder field on filepicker seems broken

Created on 8 Jun 2018  路  9Comments  路  Source: getgrav/grav-plugin-admin

I have updated to 1.8.3 and now the folder field in my custom blueprint does not seem to work anymore:

header.brands_1:
  type: filepicker
  folder: 'theme@:/images/brands'
  preview_images: true
  toggleable: true

In previous versions, it used to list files that are in my theme folder, now it shows files in the page. How can I overcome this problem?

Thank you.

bug

Most helpful comment

Same here. Filepicker in blueprints.yaml for theme settings works fine. Same field definition (apart from fieldname) in blueprints/default.yaml does not show any image. Also page@:/images in blueprints/default.yaml does not work.

headerImage:
  type: filepicker
  folder: 'theme@:/images'
  label: Select image as header
  preview_images: true
  accept:
    - .png
    - .jpg

Update 1:
When adding an image next to the page file, it is seen by the filepicker, but still ignoring folder: 'theme@:/images'

Update 2:
Rollbacked admin plugin step by step. Filepicker stopped working as of commit [ee8e488] 'Added custom object support for filepicker field'.

All 9 comments

Same here. Filepicker in blueprints.yaml for theme settings works fine. Same field definition (apart from fieldname) in blueprints/default.yaml does not show any image. Also page@:/images in blueprints/default.yaml does not work.

headerImage:
  type: filepicker
  folder: 'theme@:/images'
  label: Select image as header
  preview_images: true
  accept:
    - .png
    - .jpg

Update 1:
When adding an image next to the page file, it is seen by the filepicker, but still ignoring folder: 'theme@:/images'

Update 2:
Rollbacked admin plugin step by step. Filepicker stopped working as of commit [ee8e488] 'Added custom object support for filepicker field'.

@Lazza @pamtbaau I fixed the issue, if you need the fix right away, please see my fix. :)

@mahagr unfortunately it does not seem to work properly. Is there any debug info I should provide?

@Lazza The fix has not yet been merged into the master branch.
When I clone the develop branch into my user/plugins/admin folder, it works fine for me.

@pamtbaau I will try... but why is the commit mentioned in the release notes for 1.8.4 then? 馃槄

Edit: it works with the developer branch.

Has this fix been applied to whichever branch is being used when updating the plugin from the admin panel? The 'folder' field is not working for me. I'm using all the latest codebase.

FYI -- Tested Developer branch as well, and not able to get it to work. Still shows the images directly within the @self page instead of images from any other directory specified in 'folder'

.text_image__image:
type: filepicker
folder: 'theme@:/images/pages'
preview_images: true
acccept:
- .png
- .jpg
- .gif
- .svg

This works just fine in Admin 1.9.12 for me.

Used this page blueprint to test the issue:

extends@: default

form:
  fields:
    tabs:
      fields:
        image:
          type: tab
          title: Image
          fields:
            header.text_image__image:
              type: filepicker
              label: Image
              folder: 'theme@:/images'
              preview_images: true
              acccept:
                - .png
                - .jpg
                - .gif
Was this page helpful?
0 / 5 - 0 ratings