class Broken in Drupal 8
Same name in this branch
- 8 core/lib/Drupal/Core/Block/Plugin/Block/Broken.php \Drupal\Core\Block\Plugin\Block\Broken
- 8 core/lib/Drupal/Core/Entity/Plugin/EntityReferenceSelection/Broken.php \Drupal\Core\Entity\Plugin\EntityReferenceSelection\Broken
- 8 core/modules/views/src/Plugin/views/area/Broken.php \Drupal\views\Plugin\views\area\Broken
- 8 core/modules/views/src/Plugin/views/relationship/Broken.php \Drupal\views\Plugin\views\relationship\Broken
- 8 core/modules/views/src/Plugin/views/filter/Broken.php \Drupal\views\Plugin\views\filter\Broken
- 8 core/modules/views/src/Plugin/views/sort/Broken.php \Drupal\views\Plugin\views\sort\Broken
- 8 core/modules/views/src/Plugin/views/argument/Broken.php \Drupal\views\Plugin\views\argument\Broken
- 8 core/modules/views/src/Plugin/views/field/Broken.php \Drupal\views\Plugin\views\field\Broken
Same name and namespace in other branches
- 9 core/lib/Drupal/Core/Block/Plugin/Block/Broken.php \Drupal\Core\Block\Plugin\Block\Broken
- 10 core/lib/Drupal/Core/Block/Plugin/Block/Broken.php \Drupal\Core\Block\Plugin\Block\Broken
Defines a fallback plugin for missing block plugins.
Plugin annotation
@Block(
id = "broken",
admin_label = @Translation("Broken/Missing"),
category = @Translation("Block"),
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
- class \Drupal\Core\Block\Plugin\Block\Broken implements BlockPluginInterface uses BlockPluginTrait, CacheableDependencyTrait
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
Expanded class hierarchy of Broken
1 file declares its use of Broken
- BlockManagerTest.php in core/
tests/ Drupal/ Tests/ Core/ Block/ BlockManagerTest.php
6 string references to 'Broken'
- View::addDisplay in core/
modules/ views/ src/ Entity/ View.php - Adds a new display handler to the view, automatically creating an ID.
- views.argument.schema.yml in core/
modules/ views/ config/ schema/ views.argument.schema.yml - core/modules/views/config/schema/views.argument.schema.yml
- views.field.schema.yml in core/
modules/ views/ config/ schema/ views.field.schema.yml - core/modules/views/config/schema/views.field.schema.yml
- views.filter.schema.yml in core/
modules/ views/ config/ schema/ views.filter.schema.yml - core/modules/views/config/schema/views.filter.schema.yml
- views.relationship.schema.yml in core/
modules/ views/ config/ schema/ views.relationship.schema.yml - core/modules/views/config/schema/views.relationship.schema.yml
File
- core/
lib/ Drupal/ Core/ Block/ Plugin/ Block/ Broken.php, line 20
Namespace
Drupal\Core\Block\Plugin\BlockView source
class Broken extends PluginBase implements BlockPluginInterface {
use BlockPluginTrait;
use CacheableDependencyTrait;
/**
* {@inheritdoc}
*/
public function build() {
return $this
->brokenMessage();
}
/**
* {@inheritdoc}
*/
public function blockForm($form, FormStateInterface $form_state) {
return $this
->brokenMessage();
}
/**
* Generate message with debugging information as to why the block is broken.
*
* @return array
* Render array containing debug information.
*/
protected function brokenMessage() {
$build['message'] = [
'#markup' => $this
->t('This block is broken or missing. You may be missing content or you might need to enable the original module.'),
];
return $build;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
BlockPluginInterface:: |
constant | Indicates the block label (title) should be displayed to end users. | ||
BlockPluginTrait:: |
protected | property | The transliteration service. | |
BlockPluginTrait:: |
public | function | ||
BlockPluginTrait:: |
protected | function | Returns generic default configuration for block plugins. | |
BlockPluginTrait:: |
protected | function | Indicates whether the block should be shown. | 16 |
BlockPluginTrait:: |
public | function | 13 | |
BlockPluginTrait:: |
public | function | 3 | |
BlockPluginTrait:: |
public | function | Creates a generic configuration form for all block types. Individual block plugins can add elements to this form by overriding BlockBase::blockForm(). Most block plugins should not override this method unless they need to alter the generic form elements. | 2 |
BlockPluginTrait:: |
public | function | ||
BlockPluginTrait:: |
public | function | 19 | |
BlockPluginTrait:: |
public | function | 1 | |
BlockPluginTrait:: |
public | function | 1 | |
BlockPluginTrait:: |
public | function | 3 | |
BlockPluginTrait:: |
public | function | ||
BlockPluginTrait:: |
public | function | ||
BlockPluginTrait:: |
public | function | ||
BlockPluginTrait:: |
public | function | Sets the transliteration service. | |
BlockPluginTrait:: |
public | function | Most block plugins should not override this method. To add submission handling for a specific block type, override BlockBase::blockSubmit(). | |
BlockPluginTrait:: |
protected | function | Wraps the transliteration service. | |
BlockPluginTrait:: |
public | function | Most block plugins should not override this method. To add validation for a specific block type, override BlockBase::blockValidate(). | 1 |
BlockPluginTrait:: |
public | function | 22 | |
Broken:: |
public | function |
Returns the configuration form elements specific to this block plugin. Overrides BlockPluginTrait:: |
|
Broken:: |
protected | function | Generate message with debugging information as to why the block is broken. | |
Broken:: |
public | function |
Builds and returns the renderable array for this block plugin. Overrides BlockPluginInterface:: |
|
CacheableDependencyTrait:: |
protected | property | Cache contexts. | |
CacheableDependencyTrait:: |
protected | property | Cache max-age. | |
CacheableDependencyTrait:: |
protected | property | Cache tags. | |
CacheableDependencyTrait:: |
public | function | 3 | |
CacheableDependencyTrait:: |
public | function | 3 | |
CacheableDependencyTrait:: |
public | function | 3 | |
CacheableDependencyTrait:: |
protected | function | Sets cacheability; useful for value object constructors. | |
DependencySerializationTrait:: |
protected | property | An array of entity type IDs keyed by the property name of their storages. | |
DependencySerializationTrait:: |
protected | property | An array of service IDs keyed by property name used for serialization. | |
DependencySerializationTrait:: |
public | function | 1 | |
DependencySerializationTrait:: |
public | function | 2 | |
MessengerTrait:: |
protected | property | The messenger. | 29 |
MessengerTrait:: |
public | function | Gets the messenger. | 29 |
MessengerTrait:: |
public | function | Sets the messenger. | |
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | 1 |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
PluginBase:: |
public | function |
Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
3 |
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function | Determines if the plugin is configurable. | |
PluginWithFormsTrait:: |
public | function | ||
PluginWithFormsTrait:: |
public | function | ||
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. |