Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d8 / hook / block_build_alter.twig
index ca8794b49b9573e719ec9471fc297be99ba9b968..9c5bf293dad6f2ca46ef78b62dd0e70941c94062 100644 (file)
@@ -3,7 +3,7 @@
  */
 function {{ machine_name }}_block_build_alter(array &$build, \Drupal\Core\Block\BlockPluginInterface $block) {
   // Add the 'user' cache context to some blocks.
-  if ($some_condition) {
+  if ($block->label() === 'some condition') {
     $build['#cache']['contexts'][] = 'user';
   }
 }