- Issue created by @alexpott
- Merge request !133Use filtered text to look for entity_usage as these are the links that a user actually sees β (Open) created by alexpott
- π¬π§United Kingdom alexpott πͺπΊπ
Now to add test coverage...
- π¬π§United Kingdom alexpott πͺπΊπ
I've been thinking about this issue and it makes me wonder if we should be maintaining:
- \Drupal\entity_usage\Plugin\EntityUsage\Track\EntityEmbed
- \Drupal\entity_usage\Plugin\EntityUsage\Track\HtmlLink
- \Drupal\entity_usage\Plugin\EntityUsage\Track\MediaEmbed
- \Drupal\entity_usage\Plugin\EntityUsage\Track\LinkIt
- \Drupal\entity_usage\Plugin\EntityUsage\Track\CkeditorImage
I think we should have a single text field plugin that uses the processed text (and summary if available) to determine usage. The plugin should support entity usage discovery from both the URL and the
data-entity-uuid
anddata-entity-type
attributes.This approach would have the following advantages:
- No double reporting from LinkIt/ EntityEmbed / CkEditorImage / MediaEmbed - these plugins are all essentially the same - they use the attributes to determine if there is a link
- A single plugin working through all the links is more performant and less code to maintain
- Support for any esoteric filter that adds links in a way not covered by the existing plugins
- π¬π§United Kingdom alexpott πͺπΊπ
@marcosano has pointed out that entity embed is a problem. Entity embed possibly will add links to other entities and we wouldn't want these usages registered as part of the entity with text field... so yeah #4 is wrong-headed.
That said I think it points to the fact that we could reorganise the plugin relationships so we only have to create the dom for each text field once.