Problem/Motivation

#3600574: Use Drupal core RevisionHtmlRouteProvider causes "Access denied" on log revisions, and doesn't allow them to be reverted.

This is because the Entity API module provided revision route access checking, but Drupal core does not. We need to roll our own. We also need to define the revision-revert form class in the entity definition, otherwise the following error appears when you try to revert a revision:

Uncaught PHP Exception Drupal\\Component\\Plugin\\Exception\\InvalidPluginDefinitionException: "The "log" entity type did not specify a "revision-revert" form class."

Proposed resolution

We already provide "view all log revisions" and "revert all log revisions" permissions. We just need to implement hook_entity_access() and check that the user has the appropriate permission.

We also need to define the revision-revert form class in the log entity definition. Core provides a class for this that we can use.

Remaining tasks

Do it.

User interface changes

None.

API changes

None.

Data model changes

None.

Issue fork log-3601012

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

m.stenta created an issue. See original summary.

m.stenta’s picture

Status: Active » Needs review

  • m.stenta committed 21637b3e on 4.x
    Issue #3601012: Fix access to log entity revisions
    
m.stenta’s picture

Status: Needs review » Fixed

Merged and released in 4.0.2.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.