Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 299183

Paragraph permission issue on Layout builder

$
0
0

Problem/Motivation

Parent issue: #3090200

This is interesting issue at Comment#25, 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.


Viewing all articles
Browse latest Browse all 299183

Latest Images

Trending Articles



Latest Images