Problem/Motivation

With publish_only on, a paragraph saved by itself, such as with a JSON:API PATCH, can put an error on a published page. Paragraphs makes no new revision for such a save, so it changes the revision the live page already shows. The PATCH answers 200 with the error in meta.vale, and anonymous visitors see the new text.

A bundle lint also labels a paragraph that only a newer draft holds as "(previous revision)". That is the label Paragraphs gives it, which compares the paragraph with the host's published revision.

Steps to reproduce

  1. Turn on publish_only. Publish a page that holds a paragraph with a checked text field.
  2. PATCH that paragraph over JSON:API with text that has an error-level alert.
  3. The PATCH answers 200, and the published page shows the new text.

Proposed resolution

Treat a paragraph's own save as a publishing save when it changes the revision a published host shows. A form that checks the paragraph for its host, such as the Paragraphs widget, leaves the decision to the host's save, so drafts still save with their errors. Label a paragraph in a bundle lint from the host revision that holds it.

Remaining tasks

Review.

Issue fork vale-3634055

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 1ea93b6e on 1.0.x
    fix(#3634055): refuse a paragraph save that changes a published page in...
deciphered’s picture

Status: Active » Fixed

Merged into 1.0.x with MR !13, and it will be in the next release.

With publish_only on, Vale now checks a paragraph saved by itself as a publishing save when a published page shows the revision it changes. A JSON:API PATCH with an error-level alert answers 422, and the live page keeps its text. A paragraph saved through the host's form, or as a new revision, still follows the host's save, so drafts still save with their errors.

A bundle lint now labels a paragraph from the host revision that holds it. A paragraph that only a newer draft holds is no longer reported as "(previous revision)".

The merge also holds phpstan/phpstan below 2.3.4 in the build, because 2.3.4 stops Rector from linting.

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.