Problem/Motivation There are potential use-cases for allowing the flagging of config entities.
In the message_subscribe module, flags are used to denote subscriptions:
This screenshot from the original IS isn't from message_subscribe, but indicates the same use case:
where announcements and discussions are flagged node types.
Proposed resolution
Utilize the Dynamic Entity Reference module for the flagging entity's reference column (now a single flagged_entity base field.)
``` $fields['flagged_entity'] = BaseFieldDefinition::create('dynamic_entity_reference') ->setLabel(t('Flagged entity')) ->setDescription(t('The entity that has been flagged.')) ->setCardinality(1) ->setRequired(TRUE);
```
This replaces the previous 3 base fields on the flagging entity (entity_type, entity_id, and the computed flagged_entity).
Remaining tasks User interface changes API changes Data model changes