core/lib/Drupal/Core/Block/BlockPluginInterface.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/core/lib/Drupal/Core/Block/BlockPluginInterface.php b/core/lib/Drupal/Core/Block/BlockPluginInterface.php index ce1e33f..cd6811a 100644 --- a/core/lib/Drupal/Core/Block/BlockPluginInterface.php +++ b/core/lib/Drupal/Core/Block/BlockPluginInterface.php @@ -63,12 +63,10 @@ public function access(AccountInterface $account, $return_as_object = FALSE); /** * Builds and returns the renderable array for this block plugin. * - * This must be the final renderable array. Otherwise Block module will not be - * able to detect whether this block has no content. (Blocks without content - * are not rendered, but if a non-final renderable array is returned — usually - * a render array that has #pre_render callbacks defined, to further build the - * render array — then Block module cannot determine whether the block has no - * content.) + * If a block should not be rendered because it has no content, then this + * method must also ensure to return no content: it must then only return an + * empty array, or an empty array with #cache set (with cacheability metadata + * indicating the circumstances for it being empty). * * @return array * A renderable array representing the content of the block.