You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you remove an image from Filepond, the image itself is deleted from the filesystem, but the Livewire property isn't updated.
When you revert an new uploaded image from Filepond, the Livewire property is removed and generates this error:
Property [$image] not found on component: [...]
It also doesn't delete the file from the temporary directory in this case, because this only happens when the $property is an array.
How to reproduce the bug
When the image already exists and is filled (edit form), and I remove the image (click the X icon), it removed the file from the filesystem. When you inspect the Livewire component data, it is still filled.
When the image is empty, and I upload an image, and click the revert image (the X), it gives the error.
Package Version
1.0.2
PHP Version
8.2.21
Laravel Version
v11.16.0
Which operating systems does with happen with?
macOS
Notes
I added the following line in the remove method in my component, which overwrites the one in the WithFilepond trait.
This works for me, as my property is nullable, not sure how to generally fix it tbh.
...data_set($this, $property, null);
You could also fire an file-removed event for example when a file is deleted.
Not sure about 'the best' solution. 😉
The text was updated successfully, but these errors were encountered:
I'd accept a PR that sets the property to null (It should work with just doing $this->$property = null, the property needs to be nullable anyway I think if you want to use Livewire file uploads
What happened?
When you
remove
an image from Filepond, the image itself is deleted from the filesystem, but the Livewire property isn't updated.When you
revert
an new uploaded image from Filepond, the Livewire property is removed and generates this error:It also doesn't delete the file from the temporary directory in this case, because this only happens when the
$property
is an array.How to reproduce the bug
When the image already exists and is filled (edit form), and I remove the image (click the X icon), it removed the file from the filesystem. When you inspect the Livewire component data, it is still filled.
When the image is empty, and I upload an image, and click the revert image (the X), it gives the error.
Package Version
1.0.2
PHP Version
8.2.21
Laravel Version
v11.16.0
Which operating systems does with happen with?
macOS
Notes
I added the following line in the
remove
method in my component, which overwrites the one in theWithFilepond
trait.This works for me, as my property is nullable, not sure how to generally fix it tbh.
You could also fire an
file-removed
event for example when a file is deleted.Not sure about 'the best' solution. 😉
The text was updated successfully, but these errors were encountered: