Closed jeffcaulfield-morphsites closed 5 months ago
@jeffcaulfield-morphsites I have a few tiny questions ;)
Either I'm missing some files to look at or I'm missing the point of all these changes.
trait AvailableFieldsAsFieldCollection
anywhere?FieldCollection
is only used in AvailableFieldsAsFieldCollection::availableFields
but this trait is again, not used anywhere?I'm not quite sure what the intend was here. I was searching for several methods to obtain a flat collection of fields fixing the dependsOn
problem. I have to say honestly that FieldCollection::findFieldByAttribute
and FieldCollection::flattenGroups
are quite messy.
I would indeed applaud for a custom FieldCollection to flatten the layouts to obtain all fields.
@wize-wiz As mentioned in my original comment, this is a cherry-pick of the changes from an issue opened a long time ago to fix a specific problem related to File/Image fields in the context of a flexible content section. I tried to bring the changes forward more or less verbatim, only without the PSR reformatting "noise" of #291.
I'll have to look at this again later an see if I missed something during the cherry-pick operation. The changes definitely seemed to fix the "delete" problem on an earlier version of this component…
cc @flxsource
My apologies: I thought I'd tested this change but apparently I was mistaken. I'll withdraw this pull request and try again later.
This is a cherry-pick of the changes from #291 (without all the reformatting)—in turn derived from #108—to make the "delete" button work on File fields in flexible layout sections.