Open whollaus opened 5 years ago
Can you please provide your YAML for the form definition in a code block??
extends@: default
form:
fields:
tabs:
fields:
content:
fields:
header.image1:
type: file
label: Image
avoid_overwriting: true
destination: '@self'
multiple: false
style: vertical
accept:
- image/jpg
- image/jpeg
Checked the bug with the latest version (Grav v1.6.0-rc.1 - Admin v1.9.0-rc.1). Does not work yet. I think that's really a big bug. Too big for a final release version :) Please let me know if you need more details. Thank you very much.
Can you also show us the yaml from the page itself as well as twig file for the page type?
I have used a fresh installation with the quark theme, only change the default.yaml file from
extends@: default
form:
fields:
tabs:
fields:
advanced:
fields:
columns:
fields:
column1:
fields:
header.body_classes:
markdown: true
description: 'Available classes in Quark Theme (space separated):<br />`header-fixed`, `header-animated`, `header-dark`, `header-transparent`, `sticky-footer`'
to
extends@: default
form:
fields:
tabs:
fields:
content:
fields:
header.image1:
type: file
label: Image
avoid_overwriting: true
destination: '@self'
multiple: false
style: vertical
accept:
- image/jpg
- image/jpeg
This is actually a known bug, which I was going to fix before release.
@rhukster
Alright, this issue exists also in older versions of Grav -- file field stores the full path which breaks if the page gets moved. There's really no easy way to fix this issue; it can be fixed, but the fix is pretty involved (unless we use Flex).
Only as an idea: The problem is that a fixed path is saved. Perhaps it would be better to save the destination from the Blueprint only?
path: user/pages/02.test/test.jpg -> path: {{ @self }}/test.jpg
In the frontend, the path must then be replaced by the currently valid one. Would also be possible as an additional function like destination: {{ @self }}/test.jpg.
I'm sorry, it's me again. :)
[Latest Admin Version: Grav v1.6.0-beta.7 - Admin v1.9.0-beta.7]
There are two demo sites![grafik](https://user-images.githubusercontent.com/4582757/50141093-e2898200-02a6-11e9-8f6b-9d70d41b7a96.png)
I add one file field (Blueprint see below) an upload a file to the Typography Page (the second page)![grafik](https://user-images.githubusercontent.com/4582757/50141296-6f344000-02a7-11e9-8407-c5a3a5dbeb17.png)
After that I change the sorting:![grafik](https://user-images.githubusercontent.com/4582757/50141113-f1703480-02a6-11e9-9f2d-0d7f16b3f9e8.png)
After saving, the image is no longer displayed.![grafik](https://user-images.githubusercontent.com/4582757/50141340-87a45a80-02a7-11e9-85f9-ec8285d69399.png)
-> The path is not automatically adjusted when you re-sort
`extends@: default
form: fields: tabs: fields: content: fields: header.image1: type: file label: Image avoid_overwriting: true destination: '@self' multiple: false style: vertical accept: