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
Comment | File | Size | Author |
---|---|---|---|
#5 | update-revision-id-2878421-5.patch | 2.46 KB | eric.chenchao |
Comments
Comment #2
eric.chenchao CreditAttribution: eric.chenchao commentedComment #3
eric.chenchao CreditAttribution: eric.chenchao commentedComment #5
eric.chenchao CreditAttribution: eric.chenchao commentedFix space issue.
Comment #6
eric.chenchao CreditAttribution: eric.chenchao commentedAlso reported to content_moderation module #2878438: Update {content_revision_tracker} after the most recent (draft) revision is deleted.