I'm not sure exactly why the old code was causing an infinite loop, nor why this fixes it - but it does fix it. I haven't been able to force it to give me an infinite loop scenario with these changes.
Note that in the below reproduction steps any upload field in an entwine admin section will do. Bonus points if it has an $owns on the relation, so you can confirm the draft label is correctly updated.
Upload field issue (asset-admin + blog failure)
Looks like it's deep in react code, no idea how to fix, replication steps:
Behat failure was the first scenario in 'multi-file-upload-field.feature'
The code being changed was originally added in https://github.com/silverstripe/silverstripe-asset-admin/pull/1263 with the intention of ensuring the "draft" label is correctly removed when saving a DataObject which
$owns
the file relation.I'm not sure exactly why the old code was causing an infinite loop, nor why this fixes it - but it does fix it. I haven't been able to force it to give me an infinite loop scenario with these changes.
Parent issue
Note that in the below reproduction steps any upload field in an entwine admin section will do. Bonus points if it has an
$owns
on the relation, so you can confirm the draft label is correctly updated.