Open fvsch opened 1 year ago
This is caused by changing the file without saving the page. Because unsaved changes still holds the old file media paths.
Media directory is /media/pages/test/cf8d1dead3-1678881816
{
"api": "/pages/test",
"originals": {
"text": "",
"my_image": [
],
"uuid": "pjZ8Nz3qANH3kXI2"
},
"changes": {
"my_image": [
{
"id": "test-1.jpg",
"image": {
"back": "pattern",
"color": "orange-400",
"cover": false,
"icon": "image",
"ratio": "3/2",
"url": "http://localhost/test/kirby/starterkit-3.9.2/media/pages/test/cf8d1dead3-1678881816/test-1.jpg",
"src": "data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw",
"srcset": "http://localhost/test/kirby/starterkit-3.9.2/media/pages/test/cf8d1dead3-1678881816/test-1-352x.jpg 352w, http://localhost/test/kirby/starterkit-3.9.2/media/pages/test/cf8d1dead3-1678881816/test-1-864x.jpg 864w, http://localhost/test/kirby/starterkit-3.9.2/media/pages/test/cf8d1dead3-1678881816/test-1-1408x.jpg 1408w"
},
"info": "",
"link": "/pages/test/files/test-1.jpg",
"sortable": true,
"text": "test-1.jpg",
"uuid": "file://qi1lns0WNO8avYmO",
"dragText": "(image: test-1.jpg)",
"filename": "test-1.jpg",
"type": "image",
"url": "http://localhost/test/kirby/starterkit-3.9.2/media/pages/test/cf8d1dead3-1678881816/test-1.jpg"
}
]
}
}
Media directory is /media/pages/test/cf8d1dead3-1678881908
@distantnative @bastianallgeier Is it possible to update the new path of a file replaced from FileView by finding the file at the under of any page in unsaved changes? It seems a bit difficult to me 🤷♂️ If you have a suggestion for a solution, I would like to try.
This is super tricky with the unsaved changes in localStorage. Not sure if there'd be a stable fix. I'd assume this would be resolved with keeping unsaved/unpublished changes on the backend.
Description
When a page blueprint has an files field with a single image, and in Panel you click through to that file's view and replace the file, then go back to the page view: that image appears broken in the page view.
Screenshots
Expected behavior
When going back to the page edit view, the replace image should appear in the image field.
To reproduce
Create a new plainkit project with
composer create-project getkirby/plainkit
Start a development server with
composer start
Create a
site/blueprints/pages/test.yml
blueprint with:In the Panel, create a new page with the type “Test page”
Upload an image. I used an image called
image1.png
for testing.Click on the image card to end up on the image editing view (at
http://localhost:8000/panel/pages/test/files/image1.png
in my test).Use the “Replace file” feature to replace the image with a new upload. I used a second file named
image2.png
in my test.Go back to the page that contains the image.
It looks like the generated images used to display the image don't exist anymore (after the file was replaced). The HTML for the image preview looks like this:
Those URLs in the
srcset
attribute are all 404s after step 7 (replacing the image).Your setup
Kirby Version
3.9.2
Console output
Your system (please complete the following information)