Ability to opt out of "Content Block" restrictions [Performance degradation]

Created on 10 August 2022, over 2 years ago
Updated 16 May 2024, 7 months ago

Problem/Motivation

When working on a site with a large amount of Blocks, this module can cause PHP memory limits to be hit when trying to visit the manage display page with Layout Builder enabled.

I've asked a couple of other developers (colleagues) and they seem to experience the same.

Steps to reproduce

  1. Have a large amount of blocks
  2. Try to visit the manage display page of a content type where Layout Builder is enabled.

Root cause

This performance problem is due to the number of options that the interface has to *render* (in contrast to business logic or database calls). Specifically, it has to render a checkbox element for each of the blocks in the system *twice*, once for the allow-list restrictions, and once for the deny-list restrictions.

Proposed resolution

1. Add a setting for this module that allows sites to suppress "Custom blocks" from being restricted via the UI.
2. Point to our existing documentation ( https://www.drupal.org/docs/contributed-modules/layout-builder-restricti β†’ ...) that explains how sites can programmatically set restrictions for individual custom blocks.

Rationale: although this seems like a sacrifice, I speculate that the types of sites that experience this performance problem (i.e., one with thousands of reusable blocks) likely don't want content editors to have a list of those thousands of reusable blocks to be place-able via Layout Builder. So maybe this option wouldn't negatively affect them.

✨ Feature request
Status

Needs review

Version

3.0

Component

Code

Created by

πŸ‡§πŸ‡ͺBelgium tim-diels Belgium πŸ‡§πŸ‡ͺ

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

Merge Requests

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