- 🇫🇮Finland lauriii Finland
It looks like
\Drupal\block\BlockViewBuilder::preRender
also explicitly adds support forNULL
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 allowNULL
as the empty value as well, since it's supported by\Drupal\block\BlockViewBuilder::preRender
. - Merge request !11049Issue #3162699: Improve debugability of block plugins returning NULL in Layout Builder → (Closed) created by tim.plunkett
- 🇺🇸United States tim.plunkett Philadelphia
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. But let's not let it slow us here.
Converted the patch to an MR and added more tests.
- 🇺🇸United States smustgrave
Opened 📌 Fix BlockViewBuilder to handle NULL and [] Active per #23
Ran the test-only feature to show the coverage
Looking at the change don't see anything else pending. LGTM
- 🇬🇧United Kingdom catch
Looks good, I wondered if we should add @throws to the method but it's not really an API method anyway and there's a @todo to remove it in one of the multiple follow-ups. Committed/pushed to 11.x, thanks!
Automatically closed - issue fixed for 2 weeks with no activity.