Open edwinvdpol opened 1 month ago
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
I have a similar issue if the validation of the uploaded file fail, then the error messages is not cleared when the file is deleted
@edwinvdpol check this #9
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 yourevert
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. 😉