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
- Turn on
publish_only. Publish a page that holds a paragraph with a checked text field. - PATCH that paragraph over JSON:API with text that has an error-level alert.
- 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
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
decipheredMerged into 1.0.x with MR !13, and it will be in the next release.
With
publish_onlyon, 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/phpstanbelow 2.3.4 in the build, because 2.3.4 stops Rector from linting.