Problem/Motivation
In discussion with @chr.fritsch, @daniel.bosen and @mtodor we realised that there was a need to reliably get the ID of the active entity for a specific feature. This allows code to work with selected configuration without caring which one is selected.
Proposed resolution
Add a service to provide this functionality.
Remaining tasks
User interface changes
None
API changes
New service
Data model changes
None
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | 2946544-7.patch | 9.82 KB | alexpott |
| #7 | 5-7-interdiff.txt | 400 bytes | alexpott |
| #5 | 2946544-5.patch | 9.81 KB | alexpott |
| #5 | 3-5-interdiff.txt | 13.95 KB | alexpott |
| #3 | 2946544-3.patch | 12.56 KB | alexpott |
Comments
Comment #2
alexpottInitial work - one @todo where we have multiply active entities.
Comment #3
alexpottUpdated to deal with the situation when there are two active configurations. The
config_selector.activeservice will always select the one with the highest priority. Which I think is inline with the expectations set by the module.Comment #4
chr.fritschThis does not correspond. Also, the method name getEntityFromEntity is not really expressive.
Comment #5
alexpottGood point. Cleaned it up to have less surface area and a cleaner API.
\Drupal\config_selector\ActiveEntity::get($entity_type_id, $feature);\Drupal\config_selector\ActiveEntity::getFromEntity($entity);Comment #6
chr.fritschNice, thats much more intuitive now.
One nitpick:
ActiveEntity now
Comment #7
alexpottFixed! @chr.fritsch eagle eyes!
Comment #8
chr.fritschLooks good to me
Comment #9
alexpottThanks for the reivew @chr.fritsch