This is a followup ticket from #3026024: Moderation state missing on locked entities, as it seems the ticket purpose has changed in the meantime.

Problem/Motivation

When the content is locked by user A, user B can still change the moderation state and potentialy publish a draft which is being locked.
The moderation state cannot be changed on the entity edit form, this works as expected, but when using the content moderation form, you can still change the status.

Steps to reproduce

Given: a node that has a published version and a draft version.

  1. Open the node edit form with user 1
  2. In a separate (incognito) window open the nodes draft page with user 2 (/node/123/latest)
  3. With user 2, change the moderation state to "Published"
  4. Save the node with user 1

Step #3 should not be possible.
Step #4 will show a "The content has either been modified by another user, or you have already submitted modifications. As a result, your changes cannot be saved." error message.

Proposed resolution

Disable the content moderation form when the content is locked by another user.

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

ludo.r created an issue. See original summary.

ludo.r’s picture

Issue summary: View changes

ludo.r’s picture

Status: Active » Needs review
StatusFileSize
new1.66 KB

And here's the patch for those who don't trust volatile Merge Requests.

ludo.r’s picture

Issue summary: View changes
ludo.r’s picture

Issue summary: View changes

alexpott made their first commit to this issue’s fork.

alexpott’s picture

Version: 8.x-2.x-dev » 3.x-dev
Category: Feature request » Bug report

The work for 3.x is slightly different from the 2.x version - it does not lock the content when you visit the entity view. That seems a bit over zealous - it completely removes the form by setting access to false.

alexpott’s picture

Status: Needs review » Reviewed & tested by the community

  • alexpott committed b68b4cb5 on 3.x
    fix: #3554181 Prevent Content moderation form to be used when content is...
alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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