Problem/Motivation

With publish_only on, editing published content inside a workspace is refused with the Vale error, although that save publishes nothing live. The revision stays in the workspace until the workspace is published, and the workspace publish check already covers its errors. A new unpublished draft in a workspace saves with its errors, as documented. Only edits of published content are refused.

PublishState::isBeingPublished() answers $entity->isPublished() without looking at the workspace, so a draft revision of published content counts as the publishing save.

Steps to reproduce

  1. Set $config['vale.settings']['publish_only'] = TRUE; and enable Workspaces.
  2. Publish a page whose body is checked with Vale.
  3. Switch to a workspace, edit the page, put an error in the body, and save.
  4. The save is refused. Expected: the edit saves as a draft in the workspace with its alerts listed, and publishing the workspace is refused.

Proposed resolution

  • Treat a save inside an active workspace as a draft, for content the workspace tracks. Ask workspaces.information, as core's save path does, so content a workspace does not track, which saves straight to Live, keeps the refusal.
  • Under publish_only, make the workspace publish the publishing save. It stops on errors, and on text Vale could not check when fail_closed is on, in advise mode as well as block. Warnings and suggestions never block.
  • Say so in the README's publish_only and workspace_mode rows, and add a changelog entry.

Remaining tasks

  • Review and merge.

Issue fork vale-3633410

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

deciphered created an issue. See original summary.

  • deciphered committed 55e27973 on 1.0.x
    fix(#3633410): treat saves of published content in a workspace as drafts
    
deciphered’s picture

Status: Active » 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.