jay3eb
FileUpload not saving cropped image - v3 BUG?
Ideally, I would think that if I upload an image to the cropper then crop it and save the cropped version that it would then remove the original and I'm only left with one image in the
$state
but that's not the case and could get more tricky if someone was using ->multiple()
. I found in file-upload.js [core file]
where this code is but didn't want to alter it in case this was by design for some reason...17 replies
FileUpload not saving cropped image - v3 BUG?
Here, I get all the files and get the last one b/c the latest one is the cropped and most recent one that I want to save. Took me days, but after diving into the code I was able to get around it.
17 replies
FileUpload not saving cropped image - v3 BUG?
Yesterday, after deep diving into the filamant core code I was able to get around this by adding this to the FileUpload component in my form... essentially overriding the
dehydrateStateUsing()
with my own:
17 replies
FileUpload not saving cropped image - v3 BUG?
@pboivin , if you could do this for me... When you upload your initial image to the cropper check the livewire-tmp folder and confirm the image is there. After that, then crop the image and recheck the livewire-tmp directory and confirm that there is now a second image. File pond will look correct and show the cropped image but when saving b/c there are 2 items in the $state, it will get the first one
( return $files[0] ): [line 113 in BaseFileUpload.php reference below]
and save to the database which is the original and not the cropped version. Below is my file upload code:
Line 113 of BaseFileUpload.php in filament core:
17 replies