Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
When creating content in, say, the 'Draft' state, there is no 'latest version' tab (which makes sense). However, since the 'latest version' tab is where the moderation form is located, there is no way to moderate a piece of content that doesn't have a forward revision (eg, has never been published).
Steps to reproduce
- Enable workflow/moderation for article nodes
- Create a new article in 'draft'
- Note there is no tab from which to moderate this entity
- Publish the article
- Add a new draft of the article, there is now a 'latest version' tab
Proposed resolution
Either dynamically rename the 'latest version' tab to moderate depending on circumstances (eg, if the entity has no latest version, but is also unpublished, then call it 'moderate'), or add a separate tab/controller that appears when the latest version tab makes no sense.
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#5 | 2870484-05.patch | 10.18 KB | jhedstrom |
Comments
Comment #2
jhedstromComment #3
jhedstromThis takes the approach of dynamically altering the tab title depending on circumstances. It seemed much more efficient than an entirely new route. It changes some assumptions that were in place, so some tests will probably break, and this new functionality will need explicit tests. Uploading now for early feedback on the approach.
Comment #5
jhedstromThis gets the tests passing, and adds coverage for the change in behavior. This might be more of a feature request, since this behavior was explicitly tested for. However, I'm not sure how folks are moderating content w/o forward revisions...
Comment #6
timmillwoodI think #2864938: Content moderation form doesn't appear on new entities might solve this issue, but in a different way.
Comment #7
jhedstromClosing as a duplicate of #2864938: Content moderation form doesn't appear on new entities. I've added #2875843: Display content moderation form on published revisions as a follow-up.