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
- Set
$config['vale.settings']['publish_only'] = TRUE;and enable Workspaces. - Publish a page whose body is checked with Vale.
- Switch to a workspace, edit the page, put an error in the body, and save.
- 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 whenfail_closedis on, inadvisemode as well asblock. Warnings and suggestions never block. - Say so in the README's
publish_onlyandworkspace_moderows, and add a changelog entry.
Remaining tasks
- Review and merge.
Issue fork vale-3633410
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
Comment #4
deciphered