Integrate with Entity Usage

Created on 23 July 2024, 9 months ago

Problem/Motivation

Firstly, thank you for this module!

Our clients use this module to insert views with contextual arguments - usually with to tag media entities with a specific term and then embed a view showing media tagged with the contextual input. This works fantastically with this module.

They also use in order to track which media has been embedded in the site.

The Entity usage uses a tracking methods provided by plugins to determine usage - e.g. the embedded media plugin tracks usage when

It would be awesome to provide a plugin to support tracking of entities when they are used as arguments for a contextual field.

Proposed resolution

Add tracking plugin

Remaining tasks

For maintainers - are you interested in this feature request (either as part of this module or a sub module) or prefer this to be its own separate module?

User interface changes

n/a

API changes

n/a

Data model changes

n/a

Feature request
Status

Active

Version

2.0

Component

Code

Created by

🇳🇿New Zealand ericgsmith

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @ericgsmith
  • 🇳🇿New Zealand ericgsmith

    I have pushed some code to a draft MR - this was mainly used to investigating if this was possible and not thoroughly tested.

    I am likely to continue testing this - but would like to know first if this is something that maintainers would accept or if it should be included as a separate or sub module?

  • 🇩🇪Germany a.dmitriiev

    That is an interesting feature. As it is its own plugin under entity usage namespace, it doesn't "hurt". So I believe nothing prevents this to land in the module. Let me know if/when you want me to test something.

  • 🇳🇿New Zealand ericgsmith

    I'm picking this back up as a client wants to move forward with this functionality.

    Having looked at Added EntityArgument and EntityReferenceArgument Views argument plugins it seems for my use case the code can be simplified a lot if I only care about 10.3.x and above as I can now find the target_entity_type_id property in the argument definition instead of parsing the fields like previously.

    I have only given this a quick test with some views that have taxonomy term id contextual filters and it works as expected.

    @a.dmitriiev I have not set this to needs review yet as I plan to tinker with it a bit more in the next few days.

  • 🇳🇿New Zealand ericgsmith

    Made some changes.

    I found that while on a local site I had target_entity_type_id in config, when I tried testing on a fresh D11 install it wasn't there - it was only discoverable by loading the argument handler (which supplements the item with the views data - which specifies the target entity).

    I then found that the term filters don't actually extend this anyway - so I've added a slightly non elegant check for the term filters.

    I see there is currently not CI setup for the project - I can raise an issue for this as it would be good to get that setup before testing / reviewing this.

Production build 0.71.5 2024