Problem/Motivation
With Content Moderation and Workspaces enabled, creating a published moderated entity in a workspace will create the default revision as published. This is a regression from #3438771: Newly added menu links are invisible until published and it's caused by CM's presave hook running after the one from Workspaces.
This issue was initially reported to the Security team, and it was cleared for being fixed in the public queue.
Steps to reproduce
1. Fresh install of Drupal 10.3.5
2. Enable Content Moderation and Workspaces
3. Enable all content for the editorial workflow at /admin/config/workflow/workflows/manage/editorial
4. Activate the Stage workspace
5. Create a basic page, set the moderation state to Published, and save it
6. Fire up anonymous browser
7. Go to /node/1
Proposed resolution
Workspaces needs to alter the publishing status after Content Moderation. Additionally, during the double-revision creation process, Workspaces should enforce that the initial default revision is unpublished.
Remaining tasks
Review.
User interface changes
None.
Introduced terminology
None.
API changes
None.
Data model changes
None.
Release notes snippet
N/A.
Issue fork drupal-3487482
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:
- 3487482-creating-a-published
changes, plain diff MR !10186
Comments
Comment #8
amateescu commentedCrediting folks from the private issue.
Comment #9
amateescu commentedFun fact: we had test coverage for this case, but the asserts where checking the Drupal frontpage assuming it would be the default content view from the Standard profile, but they were looking at the user page instead :)
Comment #10
fabianx commentedRTBC - fix is straightforward and the additional check ensures that we don’t regress in case someone else is setting the publication status for the live revision.
Comment #14
catchCommitted/pushed to 11.x and cherry-picked back through all branches to 10.3.x, thanks!
Comment #19
catch