Skip to content

Fix/file attribute images not persisting after save#2451

Open
Huncsuga wants to merge 5 commits into
lunarphp:1.xfrom
Huncsuga:fix/file-attribute-images-not-persisting-after-save
Open

Fix/file attribute images not persisting after save#2451
Huncsuga wants to merge 5 commits into
lunarphp:1.xfrom
Huncsuga:fix/file-attribute-images-not-persisting-after-save

Conversation

@Huncsuga
Copy link
Copy Markdown
Contributor

@Huncsuga Huncsuga commented Apr 18, 2026

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
.

Copilot AI review requested due to automatic review settings April 18, 2026 23:26
@github-project-automation github-project-automation Bot moved this to Todo in Roadmap Apr 18, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 the Attributes form 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.

{
parent::setUp();

$this->key('attributeData');
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

3 participants