Block Content entities should not be set to unpublished after they're replicated

Created on 9 October 2023, about 1 year ago
Updated 10 October 2023, about 1 year ago

Problem/Motivation

In ✨ Extend unpublish behavior to supported Entities Fixed , a change was made where all entities that were replicated (except Paragraphs) should be set to unpublished, assuming they supported the concept of published/unpublished.

While an exception was made for Paragraph entities, we missed adding an exception for Block Content entities, especially non-reusable Block Content entities. These "single-use" Block Content entities are used Layout Builder layouts and shouldn't be set to unpublished. They're replicated as part of replicating the layout-builder enabled entity. Once they're unpublished, there's no way to publish them in the UI. The only fix is to manually publish them via some PHP code or SQL queries.

Steps to reproduce

  1. Enable Layout Builder, with overrides, on the default entity view display for a content type
  2. Create a new node of that content type, then modify its layout and add a new Text block to the page and save
  3. A cloned, single-use (so you won't see it when browsing existing custom content blocks) Block Content entity is created, but it's set to unpublished
  4. Anonymous visitors to the cloned page won't see the cloned block. Only admins that have the correct permissions to administer blocks will see it

Proposed resolution

When unpublishing cloned entities, exclude non-reusable Content Block entities, just like we do for Paragraphs.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States bkosborne New Jersey, USA

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

Comments & Activities

Production build 0.71.5 2024