workbench_moderation module stores most recent revision ID of entities in the {workbench_revision_tracker} table. However, the revision ID won't be updated if the most recent revision is a draft and deleted. This leads to a fatal error when we use "Content latest revision" relationship in the admin content view in the lightning distro.

Steps to reproduce the issue
1. Install workben_moderation
2. Create a new standard page and publish it. (nid = 1, vid = 1)
3. Edit that page and save as draft (nid = 1, vid = 2)
4. Go to revision list.
5. Delete the draft revision (vid = 2).

Current behavior
In table {workbench_revision_tracker}, we still can see the deleted revision ID (revision_id = 2).

Expected behavior
The revision ID of that entity should be updated to most recent revision (revision_id = 1)

Solution:
Implement hook_entity_revision_delete() to update revision ID

Note:
During this test, you will find another bug in Drupal core: #2753971: ContentEntityStorageBase::deleteRevision() function does not remove node_field_revision entries

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

eric.chenchao created an issue. See original summary.

eric.chenchao’s picture

Assigned: eric.chenchao » Unassigned
Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 2: update-revision-id-2878421-2.patch, failed testing.

eric.chenchao’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 5: update-revision-id-2878421-5.patch, failed testing.