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
ifox
ifox3mo ago
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?
daison
daison3mo ago
no, removed images are still gone after reload
ifox
ifox3mo ago
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
daison
daison3mo ago
yes they show up after first save, inside the CMS UI too
ifox
ifox3mo ago
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?
daison
daison3mo ago
yes twill 3 , laravel 11
daison
daison3mo ago
this is how my model and controller form look, hope this is all good
No description
No description
daison
daison3mo ago
mediables table after first save
No description
daison
daison3mo ago
mediables table after second save
No description
ifox
ifox3mo ago
Hey @daison we're not able to reproduce this, would you be able to share a reproduction?
daison
daison3mo ago
ok, i will create a repo and share
daison
daison3mo ago
GitHub
GitHub - daisonth/twill-medias-upload-issue-reproduction
Contribute to daisonth/twill-medias-upload-issue-reproduction development by creating an account on GitHub.
daison
daison3mo ago
i have recreated the issue in this repo, hope this helps
ifox
ifox3mo ago
Thank you, we've been able to reproduce and identify a regression in https://github.com/area17/twill/pull/2567
ifox
ifox3mo ago
so twill 3.2 is not affected, it's a 3.3+ regression
Want results from more Discord servers?
Add your server