Change record status: 
Project: 
Introduced in branch: 
8.6.x
Introduced in version: 
8.6.0
Description: 

In preparation for #2957425: Allow the inline creation of non-reusable Custom Blocks in the layout builder BlockContentInterface::isReusable and BlockContentInterface::setReusable methods were added to allow Custom Block entities to be marked as non-reusable. A corresponding reusable base field was added to the block_content entity type. The default value of the reusable field is TRUE and all existing Custom Block entities on a site will be reusable.

Non-reusable blocks are intended to be used in one context only within a site such as being used in a layout provided by the Layout Builder.

The access to all existing blocks and any new blocks that are created via the Custom Block module will not affected as they will all be reusable.

An update hook updated all existing Custom Block Views including the Custom Blocks Library View that is included in the Custom Block module to only show reusable blocks. All new Views that are created through core's Views wizard will have a default filter to show only reusable blocks.

Since a Custom Block with the reusable field set to FALSE should not be reused in other parts of the site the queries of EntityReferenceSelection plugins will now automatically be altered to add:

$query->condition("$data_table.reusable", TRUE);

Unless the query satisfies one of these two conditions:

  1. It has a condition already set on the new reusable field
  2. It does not have the block_content_access tag.
Impacts: 
Module developers