Usage filtering for only latest revision

Created on 13 April 2022, over 2 years ago
Updated 19 January 2024, 11 months ago

Problem/Motivation

For the site I'm working on we need a usage-count filter in the media view. Unfortunately, the current solution has no easy way to distinguish between usage in a previous or the latest revision.

Steps to reproduce

Track usages of revisionable entities. Add a view with a filter on the sum of count or count/distinct of source_id. The usages of previous versions are also counted.

Proposed resolution

Track 'is latest revision' in the entity_usage table.

Remaining tasks

Review, tests, etc

User interface changes

None

API changes

\Drupal\entity_usage\EntityUsage::registerUsage method signature has changed.

Data model changes

New column in the entity_usage table 'source_is_latest_revision'

Feature request
Status

Needs review

Version

2.0

Component

Code

Created by

🇳🇱Netherlands spadxiii

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024