Revisit latest revision / ::getActive() param conversion behaviour

Created on 11 August 2025, 4 days ago

Problem/Motivation

Routes that specify load_latest_revision - which content_moderation does for the node edit page and similar, load the latest revision even for access checks and similar, including for users that would never be able to reach the node edit form under any circumstances.

See @berdir's notes in 📌 ContentEntityStorageBase::loadRevision() should use the static and the persistent entity cache like ContentEntityStorageBase::load() Needs work and also 🐛 Entity queries querying the latest revision very slow with lots of revisions Needs work for some background.

There are two problems:

1. The query is very slow, much less slow after 🐛 Entity queries querying the latest revision very slow with lots of revisions Needs work but still not fast.

2. Per 📌 ContentEntityStorageBase::loadRevision() should use the static and the persistent entity cache like ContentEntityStorageBase::load() Needs work revision loads aren't static cached. This can result in dozens of database queries when multiple routes are set to use the latest revision.

Steps to reproduce

Proposed resolution

If we want to keep the same behaviour in content moderation, it could take over the route itself, load the revision it needs when it's actually viewed and show that revision in the form. This would avoid loading the revision to check access on the edit tab when just viewing the node, which is the main performance issue.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

📌 Task
Status

Active

Version

11.0 🔥

Component

content_moderation.module

Created by

🇬🇧United Kingdom catch

Live updates comments and jobs are added and updated live.
  • Performance

    It affects performance. It is often combined with the Needs profiling tag.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024