Problem/Motivation
Currently new fields don't appear under data from field widget until the cache is rebuilded
Proposed resolution
Trigger a cache delete on add field.
Issue fork ui_patterns-3474141
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
christian.wiedemann commentedComment #4
christian.wiedemann commentedComment #5
christian.wiedemann commentedI borrowed the logic from layout builder. I am currently clearing the cache from SourcePluginManager and DerivableContextPluginManager.
Is it enough?
Comment #6
just_like_good_vibeswhy this in the code ? because we also borrow the sample entity gen?
i am not sure about the hook used, because there are related to field_config.
and by the way, the hooks are hook_ENTITY_TYPE_delete and hook_ENTITY_TYPE_insert ?
when the config already exist and only a field instance is added/removed, is it still ok?
Comment #7
just_like_good_vibesComment #8
christian.wiedemann commentedComment #9
christian.wiedemann commentedI checked the hooks. They are working in both cases. For adding new fields and with existings fields.
Your question "and by the way, the hooks are hook_ENTITY_TYPE_delete and hook_ENTITY_TYPE_insert ?"
The hooks are right. Not 100% what you mean.
Comment #11
just_like_good_vibesComment #12
pdureau commentedComment #13
christian.wiedemann commented