Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 294231

PHP message: Error: Call to a member function getEntityTypeId() on null (Layout Builder)

$
0
0

Problem/Motivation

If a default layout has a custom block placed and overridden layouts exist, deleting the custom block from the default can trigger
Error: Call to a member function getEntityTypeId() on null in Drupal\layout_builder\Plugin\Block\InlineBlock->build() (line 218 of core/modules/layout_builder/src/Plugin/Block/InlineBlock.php).

Steps to reproduce

  1. Add a custom block to a layout default
  2. Begin editing a layout override, do not save
  3. Remove the block from the default
  4. Attempt to continue editing the layout override

Proposed resolution

One of the following changes to \Drupal\layout_builder\Plugin\Block\InlineBlock::getEntity():

  1. allow for returning NULL (in which case all callers must account for that)
  2. throw an exception when the block cannot be loaded
  3. ALWAYS return a block (not sure that it's possible)

Remaining tasks

Write tests
Decide on a resolution

User interface changes

TBD

API changes

TBD

Data model changes

N/A

Release notes snippet

N/A


Viewing all articles
Browse latest Browse all 294231

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>