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

List with multiple file inside freezes admin panel

Started by Muut Archive 10 years ago · 16 replies · 671 views
10 years ago

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

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

YAML
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

TXT

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

TXT


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?
10 years ago

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)?

10 years ago

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.

10 years ago

Yes... I cannot scroll...

And about images and list... do you know if there's something wrong in my implementation?&quest;? Thanks!

10 years ago

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.

10 years ago

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

10 years ago

What is the specific error shown in the console?

10 years ago

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

10 years ago

Looks like a problem with the MIME type. Try

TXT
accept: ["image/*"]

should be working, can you confirm?

10 years ago

You mean with [] ?&quest;? Because it was present on the code...

10 years ago

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

10 years ago

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.

10 years ago

Remove

YAML
                  validate:
                    type: array

on the file field. This will solve that issue.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1985 9 years ago
Archive · by Muut Archive, 9 years ago
2 1338 9 years ago
Archive · by Muut Archive, 9 years ago
2 4541 9 years ago
Archive · by Muut Archive, 9 years ago
1 3392 9 years ago
Archive · by Muut Archive, 9 years ago
3 1487 9 years ago