List with multiple file inside freezes admin panel

Posted yesterday, but the post was a mes… Let me explain better:

I have this configuration for a multi file inside a list:

header.imageslist:
name: imagelist
type: list
style: vertical
fields:
.images:
type: file
style: vertical
destination: ‘@self/images’
multiple: true
accept:
– image/*
validate:
type: array
.title:
type: text
style: vertical
label: Title
validate:
type: array
--- 

After adding a title and 1 image, I open the md file and I get:

imageslist:

title: ‘Test’
images:
user/pages/01.Test/mars/images/mars.jpeg
name: mars.jpeg
type: image/jpeg
size: 53984
path: user/pages/01.Test/mars/images/mars.jpeg


But, after re-saving the file, the admin page is frozen (cannot scroll on this tab), and after opening the md file again, I see this:

imageslist:

title: ‘Test’
images:
user/pages/01.Test/mars/images/mars.jpeg:
– mars.jpeg
– image/jpeg
– ‘53984’
– user/pages/01.Test/mars/images/mars.jpeg


Notice that in the first case, the items of the file contains a <name>:<value> and in the second case, the name is missing and are listed as a list, and of course, it cannot be opened and cannot work with this file. How I can handle with this?

Well first off, is that code copied directly from a Markdown-file or editor? Cause is a special typographic character, where you really want to enclose values in regular ' or " quotes.

Second, the indentation from the first piece of code is seemingly missing, but did you try adding array: true below type: list? There is a current issue with the list-field in blueprints.

Third, when the page is frozen, does any error pop up in the console (Chrome DevTools for example, press F12)?

Hi!

Thanks for the answer.

When I mean frozen is what I can see on the image.

And about indentation and everything else, see the attached images:

Screen Shot 2017-02-20 at 13
Screen Shot 2017-02-20 at 13

By frozen I assume you mean it will not scroll. This has previously been caused by using CloudFlare’s JS optimization, or a improperly encoded language in the Admin-plugin - the latter fixed by updating to the most recent version of Grav and themes/plugins.

Yes… I cannot scroll…

And about images and list… do you know if there’s something wrong in my implementation??? Thanks!

Is there any JavaScript issue(error) listed in the browser console?

The Admin plugin is the latest version? We had a JS issue in a recent release. Also try clearing the Grav + browser caches, and hard-reload the page to make sure you got the javascript updated.

Yes, is the latest version 1.2.14… And I’ve hard-reloaded the page and still with the error…

What is the specific error shown in the console?

There’s no error, but as described below, it is when saved the md file

The file is not saved properly :frowning:

Looks like a problem with the MIME type. Try

accept: ["image/*"]

should be working, can you confirm?

You mean with [] ??? Because it was present on the code…

If I put accept: [“image/*”], the part related to image files is not saved, so, it does not fix the problem

Remember that the first time I save the file, it is saved properly, so it doesn’t seem to be a problem with the mime type. I think there’s a problem when reading WITH VALID CONTENT and writing the file again.

See the images: The first one is the one I got when I put images and I save the first time, and the second one is when I save again (without any changes)

Screen Shot 2017-02-21 at 07 Screen Shot 2017-02-21 at 07

Remove

                  validate:
                    type: array

on the file field. This will solve that issue.

You rock!!! Thanks!