- Merge request !40Issue #3328559: Hide 'Usage' tabs for bundles without usage → (Open) created by dpi
- 🇦🇺Australia mstrelan
I suspect #12 was meant to link to #3330956: Change configuration from entity type to bundle based → .
Hide 'Usage' tab where the bundle in context does not have any usages for any entities in the bundle. Presently the visibility of 'Usage' tab is configured by entity type, and is not backed by actual data.
Simply track whether a bundle has at least one usage, and put the values of these flags in an invalidatable cache. So when new bundles are added/removed we can simply invalidate and rebuild it.
We could have hidden the usage tab for entities if just the entity in context did not have usage, but I decided that its more useful for the tab to be present and display zero usages on the page than for it to be inexplicably missing for some entities.
Other notes
Currently Entity Usage project doesn't track bundle stats.
EU should probably track bundle in a new column in {entity_usage}, in the same manner as field tables do in order to efficiently delete data when a bundle is deleted.
In any case this optimisation can be made in another issue, there are ways to determine usage with SQL joins, though the logic is not foolproof.
Review
Usage tab visibility may hide automatically.
New service. Implementation introduces it but does not provide a finalised API (interface). See @internal
notes on service.
Makes use of cache API, so new cache table will be created automatically if using database backed caching.
Postponed
4.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
I suspect #12 was meant to link to #3330956: Change configuration from entity type to bundle based → .