- Issue created by @bkosborne
- πͺπΈSpain penyaskito Seville π, Spain πͺπΈ, UTC+2 πͺπΊ
This might not be only entity view displays, but any entity using layout builder.
See π [warning] The "system_menu_block:welcome" block plugin was not found Active . Easiest way to reproduce is
ddev drush si --yes demo_umami
- πΊπΈUnited States Kristen Pol Santa Cruz, CA, USA
Given this will affect Drupal CMS until we switch to XB and it makes the system look buggy, can we figure out a way to try to suppress these somehow soon? Even a hacky way?
π Block plugin not found warnings on install Active
- First commit to issue fork.
- πΊπΈUnited States phenaproxima Massachusetts
I wrote a test for this and found the cause -- the issue is the
parent::preSave()
call in\Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay::preSave()
, which invokes some inline block related hooks that expect all the block plugins in the section list to be instantiate-able, but the field block definition doesn't exist yet because apparently the block cache hasn't been cleared.Except that it has. LB does clear the block plugin cache when a field is created (in
\Drupal\layout_builder\Hook\LayoutBuilderHooks::fieldConfigInsert()
). In my test, I am very explicitly doing that. You'd expect that would cause the block to become available right away, but no, because\Drupal\layout_builder\Plugin\Derivative\FieldBlockDeriver::getFieldMap()
is only exposing fields used by entity view displays that have layout. The problem is...the view display hasn't been saved yet: We're still in the middle of pre-saving it!So I think that's your problem right there. I'm not sure what the correct solution is here because is some very sensitive logic. But at least we have a test now so we'll know we fixed it.
- πΊπΈUnited States benjifisher Boston area
I am adding the STR from Comment #3 to the issue summary. I have noticed the same thing.