-
-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[v5] Structure Field with Files Type Generates Redundant Image Data in Content Files #6992
Comments
@medienbaecker replicated basically the same results in his environment. |
Can you already say whether that's new in v5 or also a bug present in v4? Will only be able to try replicating it later. |
No issue in Kirby 4.6.1 |
Because I initially thought this was related to my plugin, I'll leave my learnings here. Maybe it helps you debug faster:
|
That's a great pointer. Note to myself: Checking these lines https://github.com/getkirby/kirby/blob/v5/develop/panel/src/components/Forms/Field/FilesField.vue#L58-L60 - maybe they send the whole object to be saved and it should just send the UUID/id. |
Nevermind, I can replicate it when actually saving it. Which is interesting cause it's right in |
I've added a nested files field test setup to the sandbox getkirby/sandbox@956587b |
This issue is worse than I thought. It also happens outside of drawers, in blocks with It can easily lead to content loss because it's overwriting the field of the parent page when uploading a file: CleanShot.2025-02-21.at.10.11.12.mp4 |
@medienbaecker We are working on this but have not yet a fix anywhere. As far as we understand it, it will affect any setup where a files field is nested (e.g. in a block, structure field...). |
|
Well, Kirby 4 it is then. Unfortunately it also happens when no matching field is found on the parent page. I've experienced it with my client yesterday. They uploaded a file, saved. Bug happened. They had unsaved changes, they saved again and then the content file was completely mangled — some fields missing completely. Might be a nice collaboration between this issue and #6869, though. |
I'm really sorry about the issue. At least, I think we are finally on a good track here. We've been pretty much in the dark for a while. Thanks for all your help to debug this. |
No worries, that's what betas are for. But I just tested it again in a 5.0.0-beta.3 plainkit. The phantom field gets added even if this field doesn't exist on the parent page. If that's different for you, please let me know. |
I've discovered an issue in Kirby 5 beta.1 through beta.3 regarding how image data is stored in content files when using structure fields with file selections.
Description:
When an image is selected in a structure field that contains a files-type field, the generated content file contains redundant and unnecessarily verbose image data. The content file includes multiple instances of the same image information, including base64 data, URLs, and metadata.
Steps to Reproduce:
Create a blueprint with a structure field containing a files field:
Add an image to this structure field through the Panel
Examine the resulting content file
Current Behavior:
The content file generates extensive redundant data for each image, including:
Multiple URL entries
Base64 encoded data
Duplicate metadata
Multiple reference paths to the same image
Environment:
Kirby Version: 5 beta.1, 5 beta.2, 5 beta.3
The text was updated successfully, but these errors were encountered: