Images getting randomly removed when saving
I am working on a singleton with multiple medias fields,
When i click the 'save as draft' button or the 'publish' button everything will get saved perfectly. Images does show in the frontend.
but when i click save for a second time, some random number of images will get removed from selection. I checked the twill_mediables table in the db, rows are also getting removed from there.
how can i fix this.
16 Replies
Hi @daison that's unexpected. I assume your medias fields have different names and you have a crop configuration for each? Do you somehow select the same images multiple times in the same medias field at different position or are they all single media fields?
Does this happen if you reload the page before saving the second time? When you reload does the form contain all your selected images from the last save?
no, removed images are still gone after reload
of course they are once they are gone from db, but I'm asking if they are showing up after the first working save
I assume they are since you said they show on the frontend but what I'm wondering is if the CMS UI reloads them correctly
yes they show up after first save, inside the CMS UI too
because if it doesn't it would explain why the second save is loosing some relationship
ok
can you compare the revisions payload of a working and a non working save?
I'll try to reproduce
this is on latest Twill 3?
yes twill 3 , laravel 11
this is how my model and controller form look, hope this is all good
![No description](https://cdn.answeroverflow.com/1254447833390780527/ss_1719153971.png)
![No description](https://cdn.answeroverflow.com/1254447833701023795/ss_1719153995.png)
mediables table after first save
![No description](https://cdn.answeroverflow.com/1254449516799856721/Screenshot_2024-06-23_at_20-21-41_localhost___localhost___thoppil_db___twill_mediables_phpMyAdmin_5.2.1.png)
mediables table after second save
![No description](https://cdn.answeroverflow.com/1254449623443963956/Screenshot_2024-06-23_at_20-23-44_localhost___localhost___thoppil_db___twill_mediables_phpMyAdmin_5.2.1.png)
Hey @daison we're not able to reproduce this, would you be able to share a reproduction?
ok, i will create a repo and share
GitHub
GitHub - daisonth/twill-medias-upload-issue-reproduction
Contribute to daisonth/twill-medias-upload-issue-reproduction development by creating an account on GitHub.
i have recreated the issue in this repo, hope this helps
Thank you, we've been able to reproduce and identify a regression in https://github.com/area17/twill/pull/2567
so twill 3.2 is not affected, it's a 3.3+ regression