Layout builder overrides on a single content item not allowed in a workspace

Created on 19 September 2018, over 5 years ago
Updated 11 April 2024, 2 days ago

Problem/Motivation

Environment:
Drupal 8.6
Workspaces in core 8.6
Layout Builder in core 8.6

Process:
1. Fresh install of Drupal 8.6
2. Workspaces is enabled with two work spaces Live and Stage as generated out of the box when workspaces was enabled
3. Layout builder and Layout Discovery are also enabled
4. Create content type with layout enabled, and specific enable "Allow each content item to have its layout customized."
5. Create a piece of content using new content type in LIVE workspace, override layout and add blocks, works fine.
6. Change into STAGE workspace, try to override layout on same content item and layout UI will not allow to add blocks or remove components.

Proposed resolution

1. Should be able to override a layout for an individual content item in STAGE workspace.
2. Changes to layout in STAGE should not be visible on LIVE environment
3. Ability to then push those layout changes and any content revisions from STAGE to LIVE.

Remaining tasks

Review.

User interface changes

Nope.

API changes

Nope.

Data model changes

The inline_block block plugin now also stores the block's ID in addition to its revision ID.

🐛 Bug report
Status

Fixed

Version

10.3

Component
Workspaces 

Last updated about 11 hours ago

No maintainer
Created by

🇦🇺Australia velocis

Live updates comments and jobs are added and updated live.
  • Blocks-Layouts

    Blocks and Layouts Initiative. See the #2811175 Add layouts to Drupal issue.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

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

  • The Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

    Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

    Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

  • 🇮🇳India pooja saraah Chennai

    Fixed failed commands on #22
    Attached patch against Drupal 10.1.x
    Attached interdiff

  • 🇺🇸United States kazajhodo

    I'm not sure if I'm doing this right, but I found that layout builder would crash and throw duplicate primary key errors on entity clone. This would also create orphaned inline_block_usage rows, with empty layout_entity_id.

    The cloned entity would also no longer save, due to the orphaned references.

    I added a check in InlineBlockEntityOperations->saveInlineBlockComponent(), for entity id. Line 233.

    The entity is always set, but in some cases the entity id would be empty, causing addUsage() to fail. This seems to work fine and nodes save layout builder properly.

    This is against 9.5, however I think its relevant to this issue? Its exactly the same as the 10.1 patch, with an addition if statement- so should be fine for 10.1 as well. If the check is in the proper spot, thats an entirely different question. At my experience level... I believe so, but not positive.

  • 🇮🇳India pooja saraah Chennai

    Fixed failed commands on #25
    Attached patch against Drupal 10.1.x

  • 🇮🇳India Prem Suthar gujrat

    Try To Fix The #26 Custom Commands Failed Patch.

  • 🇮🇳India Prem Suthar gujrat

    Try To Fix The #27 CMF.

  • 🇷🇴Romania dragos-dumi

    Updated #28 with the event from https://www.drupal.org/project/drupal/issues/3208390#comment-15200955 📌 Add an API for allowing modules to mark their forms as workspace-safe Needs work

  • Open in Jenkins → Open on Drupal.org →
    Environment: PHP 8.1 & MariaDB 10.3.22
    last update 3 months ago
    Custom Commands Failed
  • Pipeline finished with Failed
    18 days ago
    Total: 172s
    #129489
  • Pipeline finished with Success
    18 days ago
    Total: 529s
    #129492
  • Pipeline finished with Success
    18 days ago
    Total: 588s
    #129811
  • Status changed to Needs review 18 days ago
  • 🇷🇴Romania amateescu

    Converted the latest patch to a MR, changed the approach for marking LB forms as workspace-safe by using a trait and marking individual forms, so this issue doesn't depend on 📌 Add an API for allowing modules to mark their forms as workspace-safe Needs work anymore.

    Tests were added in #22, I just moved them to the Workspaces module, so removing the tag.

  • Pipeline finished with Success
    18 days ago
    Total: 525s
    #129823
  • 🇺🇸United States smustgrave

    Still probably needs @tim.plunkett sign off, but with the schema change I imagine we would need an upgrade path right?

  • 🇷🇴Romania amateescu

    Replied in the MR why I don't think an upgrade path is needed.

  • Pipeline finished with Success
    10 days ago
    Total: 496s
    #136067
  • Status changed to RTBC 3 days ago
  • 🇩🇪Germany Fabianx

    RTBC - looks great to me and makes sense!

  • Status changed to Needs review 2 days ago
  • 🇬🇧United Kingdom catch

    Would like to commit this one, but I don't understand the answer about the upgrade path entirely, so asked on the MR. Back to needs review again for that. I agree we don't need a content upgrade path, but would like to know why we don't need a config upgrade path to match the new schema.

  • Status changed to RTBC 2 days ago
  • 🇷🇴Romania amateescu

    Replied in the MR :)

    • catch committed 71a1ab74 on 10.3.x
      Issue #3000749 by amateescu, s_leu, dragos-dumi, tim.plunkett,...
    • catch committed bf22a795 on 11.x
      Issue #3000749 by amateescu, s_leu, dragos-dumi, tim.plunkett,...
  • Status changed to Fixed 2 days ago
  • 🇬🇧United Kingdom catch

    OK that's a very confusing situation, but it's not a situation that was introduced here, and the explanation is spot on, so... Committed/pushed to 11.x and cherry-picked to 10.3.x, thanks! Really nice to get this one in!

Production build https://api.contrib.social 0.62.1