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

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

amateescu created an issue. See original summary.

amateescu credited catch.

amateescu credited ekes.

amateescu’s picture

Status: Active » Needs review

Crediting folks from the private issue.

amateescu’s picture

Fun 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 :)

fabianx’s picture

Status: Needs review » Reviewed & tested by the community

RTBC - 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.

  • catch committed a917ab3a on 10.3.x
    Issue #3487482 by amateescu, catch, benjifisher, ekes, finn lewis,...

  • catch committed 8b5b2fa8 on 10.4.x
    Issue #3487482 by amateescu, catch, benjifisher, ekes, finn lewis,...

  • catch committed 381948bb on 10.5.x
    Issue #3487482 by amateescu, catch, benjifisher, ekes, finn lewis,...
catch’s picture

Version: 11.x-dev » 10.3.x-dev
Status: Reviewed & tested by the community » Fixed

Committed/pushed to 11.x and cherry-picked back through all branches to 10.3.x, thanks!

Version: 10.3.x-dev » 11.x-dev
Status: Fixed » Reviewed & tested by the community
  • catch committed b904c7c4 on 11.0.x
    Issue #3487482 by amateescu, catch, benjifisher, ekes, finn lewis,...

  • catch committed e47f7ed6 on 11.1.x
    Issue #3487482 by amateescu, catch, benjifisher, ekes, finn lewis,...

  • catch committed 9aaa6664 on 11.x
    Issue #3487482 by amateescu, catch, benjifisher, ekes, finn lewis,...

catch’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.