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