Paragraph does not invalidate parent cache tags if it wasn't published yet

Created on 21 September 2022, about 2 years ago
Updated 17 January 2024, 9 months ago

Problem/Motivation

This issue has been founded answering to Paragraphs support Postponed .

When a paragraph is created unpublished, it's not displayed on node page. No cache tags about this paragraph is attached to the rendering of this node.
If paragraph is published out of node edition form, from specific code or module like scheduler_field, it should be displayed on node, but it's not. As rendered node hadn't paragraph cache tag in its list, its cache cannot be invalidated.

Steps to reproduce

1/ Make the publish field available on paragraph form
2/ Create a published node with an unpublished paragraph
3/ Node page does not display paragraph
4/ From code, load paragraph, publish it and save it
5/ Node page does not display paragraph
6/ Clear cache OR save node (which will invalidate node cache), paragraph appears

Proposed resolution

On paragraph save, if paragraph has published option but was not published before save, invalidate parent entity.

Remaining tasks

🐛 Bug report
Status

Needs work

Version

1.0

Component

Code

Created by

🇫🇷France goz

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇵🇱Poland lamp5 Rzeszow

    That is only one scenario, the second might be:

    • create paragraph with reference to views block
    • invalidating views cache does not have any effect to paragraph and node
Production build 0.71.5 2024