- Issue created by @nikita_tt
- Merge request !33452389: make sure the valid render array is built on the laze builder callback. β (Open) created by nikita_tt
- Status changed to Needs review
6 months ago 2:10pm 4 June 2024
The website encountered an unexpected error. Try again later.
AssertionError: #lazy_builder callbacks must return a valid renderable array, got NULL from Drupal\views_block_with_lazy_builder\Plugin\Block\ViewsBlockWithLazyBuilder::viewsBlockWithLazyBuilderCallback in assert() (line 403 of core/lib/Drupal/Core/Render/Renderer.php).
assert(, '#lazy_builder callbacks must return a valid renderable array, got NULL from Drupal\views_block_with_lazy_builder\Plugin\Block\ViewsBlockWithLazyBuilder::viewsBlockWithLazyBuilderCallback') (Line: 403)
Drupal\Core\Render\Renderer->doRender(Array, 1) (Line: 240)
Drupal\Core\Render\Renderer->render(Array, 1) (Line: 165)
Drupal\Core\Render\Renderer->Drupal\Core\Render\{closure}() (Line: 627)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 166)
Drupal\Core\Render\Renderer->renderPlain(Array) (Line: 183)
Drupal\Core\Render\Renderer->doRenderPlaceholder(Array) (Line: 220)
Drupal\Core\Render\Renderer->renderPlaceholder('callback=Drupal%5Cviews_block_with_lazy_builder%5CPlugin%5CBlock%5CViewsBlockWithLazyBuilder%3A%3AviewsBlockWithLazyBuilderCallback&args%5Bsettings%5D=%7B%22id%22%3A%22views_bloc_with_lazy_builder_example%3Awpss_cp_products-recommended_products_block%22%2C%22label%22%3A%22%22%2C%22label_display%22%3A%22visible%22%2C%22provider%22%3A%22views_block_with_lazy_builder%22%2C%22views_label%22%3A%22%22%2C%22items_per_page%22%3A%22none%22%2C%22context_mapping%22%3A%5B%5D%7D&token=bV68bSVsi-ljbCZHUZbpM7exxEXMzAOoRowAvEGuiac', Array) (Line: 723)
Drupal\big_pipe\Render\BigPipe->renderPlaceholder('callback=Drupal%5Cviews_block_with_lazy_builder%5CPlugin%5CBlock%5CViewsBlockWithLazyBuilder%3A%3AviewsBlockWithLazyBuilderCallback&args%5Bsettings%5D=%7B%22id%22%3A%22views_bloc_with_lazy_builder_example%3Awpss_cp_products-recommended_products_block%22%2C%22label%22%3A%22%22%2C%22label_display%22%3A%22visible%22%2C%22provider%22%3A%22views_block_with_lazy_builder%22%2C%22views_label%22%3A%22%22%2C%22items_per_page%22%3A%22none%22%2C%22context_mapping%22%3A%5B%5D%7D&token=bV68bSVsi-ljbCZHUZbpM7exxEXMzAOoRowAvEGuiac', Array) (Line: 554)
Drupal\big_pipe\Render\BigPipe->Drupal\big_pipe\Render\{closure}()
Fiber->start() (Line: 566)
Drupal\big_pipe\Render\BigPipe->sendPlaceholders(Array, Array, Object) (Line: 305)
Drupal\big_pipe\Render\BigPipe->sendContent(Object) (Line: 112)
Drupal\big_pipe\Render\BigPipeResponse->sendContent() (Line: 423)
Symfony\Component\HttpFoundation\Response->send() (Line: 20)
When the views block doesn't have any results and doesn't have "no results behaviour" then it leads to the assertion error.
The lazy builder callback should return a valid renderable array always. So I think there is no need to use part of the rendered views block. The whole renderable array can be returned instead of only "view_build" element.