Layout builder loads latest revision of inline blocks

Created on 14 December 2024, about 1 month ago

Problem/Motivation

When creating a content using layout builder in live and adding a block to the layout, then editing its layout in a workspace changing the block and saving its layout again, all is fine. Under normal circumstances, the node can now no longer be edited in the live workspace.

However, if say one changes the logic in EntityWorkspaceConflictConstraintValidator::validate() such that edits in a live are allowed again if there is a workspace revision, then re-editing the layout again in live will show the workspace revision of the block when editing the the layout and also the block.

The expected behavior would be to not show the very latest revision when re-editing in live but only the latest live revision instead.

Steps to reproduce

On Vanilla Drupal 11.1.x

  • Enable wse_lb, workspaces_ui, layout_builder, media_library
  • Comment the code in EntityWorkspaceConflictConstraintValidator::validate()
  • Create a media (image bundle) reference field on the basic block bundle, use the media library widget
  • Configure the article content type to use layout builder enabling Allow each content item to have its layout customized. option.
  • Create an Article in live, customizing its layout and adding a basic block with an image media in it, save the layout
  • Switch to the stage workspace to edit the layout, changing the image on the block, save the layout
  • Switch back to live and edit the layout again

Expected result: Image from the live layout is displayed.
Actual result: Image from the stage layout is displayed.

Proposed resolution

Ensure the correct revision is loaded, possibly loading by block ID instead of revision ID as workspaces should automatically determine the correct revision and load that one.

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

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

Merge Requests

Comments & Activities

  • Issue created by @s_leu
  • Pipeline finished with Failed
    about 1 month ago
    Total: 384s
    #369690
  • Pipeline finished with Failed
    about 1 month ago
    Total: 455s
    #369707
  • Pipeline finished with Success
    about 1 month ago
    Total: 224s
    #369716
  • Pipeline finished with Success
    19 days ago
    Total: 303s
    #384151
  • Pipeline finished with Success
    10 days ago
    Total: 363s
    #392692
  • Pipeline finished with Canceled
    8 days ago
    Total: 145s
    #394013
  • Pipeline finished with Success
    8 days ago
    Total: 458s
    #394019
  • Pipeline finished with Success
    8 days ago
    Total: 460s
    #394094
  • Pipeline finished with Success
    8 days ago
    Total: 391s
    #394605
Production build 0.71.5 2024