Fix/file attribute images not persisting after save#2451
Open
Huncsuga wants to merge 5 commits into
Open
Conversation
Sync 05.10.2025
Sync 14.12.2025
…per state management
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a Filament 4 form state persistence issue where previously uploaded “file” attribute values were not reloaded after save, caused by overriding getKey() and breaking schema-based component resolution.
Changes:
- Removed the
getKey()override from theAttributesform component. - Uses Filament’s native
key()API to set stable component keys (default and model-specific).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
alecritson
reviewed
Apr 20, 2026
| { | ||
| parent::setUp(); | ||
|
|
||
| $this->key('attributeData'); |
Collaborator
There was a problem hiding this comment.
This will override the using method which sets a model specific key. Without then when Product and Product Variant attributes are on the same page it will cause issues.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The issue was caused by overriding getKey(), which broke Filament 4’s schema-based component resolution, preventing previously uploaded files from being reloaded in the FileUpload field. The fix restores proper key generation by using Filament’s native key() method, preserving the component hierarchy while still ensuring unique keys. This resolves the issue reported in #2450
.