Paragraph permission issue on Layout builder

Created on 7 September 2020, over 4 years ago
Updated 15 March 2024, 10 months ago

Problem/Motivation

Parent issue: #3090200 πŸ› Paragraph access check using incorrect revision of its parent, leading to issues editing and viewing paragraphs when content moderation is involved. Needs work

This is interesting issue at Comment#25 πŸ› Paragraph access check using incorrect revision of its parent, leading to issues editing and viewing paragraphs when content moderation is involved. Needs work , let me talk something.

Paragraph permission flow on Layout builder: Paragraph -> Block Content -> Inline Block -> Node

(Inline Block just contacted Block Content and Node)

After Node revert, the [Block Content] on Node Layout also revert to old revision.

But on \Drupal\paragraphs\Entity\Paragraph::getParentEntity(), it always get the new [Block Content] revision.

On Drupal\layout_builder\EventSubscriber\SetInlineBlockDependency::isBlockRevisionUsedInEntity(), it want to match [Block Content] revision.

But on Node, [Block Content] is old, Paragraph provided is new, cannot match, so no permission on Paragraph.

Steps to reproduce

- Prepare a Block Type with paragraph.
- Create a content.
- Add a Inline Block on Layout, save.
- Go back to Layout, edit the Inline Block above, save.
- Goto Revisions, revert revision to created at Step 2 .
- Goto Layout, the Inline Block content was missiong, and the Paragraph permission was missing.

Proposed resolution

Root resolution:
- Paragraph add parent_revision filed to get parent entity by revision_id. (But this need Paragraph team support and have old data problem)

Temporary solution:
- Judge Block id used in entity at \Drupal\layout_builder\EventSubscriber\SetInlineBlockDependency

Remaining tasks

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

None.

πŸ› Bug report
Status

Closed: duplicate

Version

11.0 πŸ”₯

Component
Layout builderΒ  β†’

Last updated 4 days ago

Created by

πŸ‡¨πŸ‡³China Oscaner

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.

Production build 0.71.5 2024