Commit da7d1adf authored by xjm's avatar xjm

Issue #2828372 by Sut3kh: Mistake in hook_block_build_alter example

(cherry picked from commit 7b1b981b)
parent 8a757497
......@@ -151,7 +151,7 @@ function hook_block_view_BASE_BLOCK_ID_alter(array &$build, \Drupal\Core\Block\B
function hook_block_build_alter(array &$build, \Drupal\Core\Block\BlockPluginInterface $block) {
// Add the 'user' cache context to some blocks.
if ($some_condition) {
$build['#contexts'][] = 'user';
$build['#cache']['contexts'][] = 'user';
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment