diff --git a/core/modules/block/lib/Drupal/block/Annotation/Block.php b/core/modules/block/lib/Drupal/block/Annotation/Block.php index 64987e6bef5..ec093be5cb0 100644 --- a/core/modules/block/lib/Drupal/block/Annotation/Block.php +++ b/core/modules/block/lib/Drupal/block/Annotation/Block.php @@ -32,4 +32,20 @@ class Block extends Plugin { */ public $admin_label = ''; + /** + * The category in the admin UI where the block will be listed. + * + * @var \Drupal\Core\Annotation\Translation + * + * @ingroup plugin_translatable + */ + public $category = ''; + + /** + * Class used to retrieve derivative definitions of the block. + * + * @var string + */ + public $derivative = ''; + } diff --git a/core/modules/block/lib/Drupal/block/Plugin/Type/BlockManager.php b/core/modules/block/lib/Drupal/block/Plugin/Type/BlockManager.php index bb76ec25cfa..e6252ebdd2a 100644 --- a/core/modules/block/lib/Drupal/block/Plugin/Type/BlockManager.php +++ b/core/modules/block/lib/Drupal/block/Plugin/Type/BlockManager.php @@ -61,7 +61,7 @@ class BlockManager extends DefaultPluginManager { parent::processDefinition($definition, $plugin_id); // Ensure that every block has a category. - if (!isset($definition['category'])) { + if (empty($definition['category'])) { $definition['category'] = $this->getModuleName($definition['provider']); } }