- Status changed to Needs work
almost 2 years ago 5:52pm 16 January 2023
Discovered this as a part of reviewing #2730631-107: Upcast node and node_revision parameters of node revision routes → , where use of a removed function did not expose lack of coverage.
\Drupal\node\Controller\NodeController::revisionPageTitle
is no longer called or has test coverage.
Currently, when a node revision is rendered by entity.node.revision
route, the label of the revision is output. However a title callback (\Drupal\node\Controller\NodeController::revisionPageTitle
) exists to change the page title to Revision of %title from %date.
Since
#2498849: Entity view controller title rendering is expensive →
was committed, a pre-render callback was to compute the title for entities being rendered. Once the callback (\Drupal\Core\Entity\Controller\EntityViewController::buildTitle
) runs, a #title
key is added to the render array. Because the key exists, the title callback for entity.node.revision
is no longer executed by $get_title
anonymous function in \Drupal\Core\Render\MainContent\HtmlRenderer::prepare
.
- go to /node/add/article and create a article
- edit this article
- check the revision created, if it's your first article (fresh installation) you can check it in /node/1/revisions/1/view
Add $node_revision->setTitle($this->revisionPageTitle($node_revision));
in ../core/modules/node/src/Controller/NodeController::revisionShow.
Code review
Existing UI:
Proposed UI:
Needs work
10.1 ✨
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.