Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / lib / Drupal / Core / Block / Plugin / Block / Broken.php
1 <?php
2
3 namespace Drupal\Core\Block\Plugin\Block;
4
5 use Drupal\Core\Block\BlockBase;
6 use Drupal\Core\Form\FormStateInterface;
7
8 /**
9  * Defines a fallback plugin for missing block plugins.
10  *
11  * @Block(
12  *   id = "broken",
13  *   admin_label = @Translation("Broken/Missing"),
14  *   category = @Translation("Block"),
15  * )
16  */
17 class Broken extends BlockBase {
18
19   /**
20    * {@inheritdoc}
21    */
22   public function build() {
23     return $this->brokenMessage();
24   }
25
26   /**
27    * {@inheritdoc}
28    */
29   public function blockForm($form, FormStateInterface $form_state) {
30     return $this->brokenMessage();
31   }
32
33   /**
34    * Generate message with debugging information as to why the block is broken.
35    *
36    * @return array
37    *   Render array containing debug information.
38    */
39   protected function brokenMessage() {
40     $build['message'] = [
41       '#markup' => $this->t('This block is broken or missing. You may be missing content or you might need to enable the original module.'),
42     ];
43
44     return $build;
45   }
46
47 }