- Issue created by @smustgrave
Follow up from π Improve debugability of block plugins returning NULL in Layout Builder Needs work
From lauriii
It looks like \Drupal\block\BlockViewBuilder::preRender also explicitly adds support for NULL type, even though it's not documented to be supported. π¬ As the error suggests, there are already type hints for ensuring it is an array, meaning that it's fine to add the exception as a DX improvement. However, we probably should allow NULL as the empty value as well, since it's supported by \Drupal\block\BlockViewBuilder::preRender.
From @tim.plunkett
Good news: returning [] and NULL have exactly the same effect. We can file a follow-up to fix BlockViewBuilder which has been wrong this whole time.
NA
Fill in
Complete summary
Implement
Review
NA
NA
NA
NA
NA
Active
11.0 π₯
layout_builder.module