summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2014-05-05 10:47:36 (GMT)
committerAlex Pott2014-05-05 10:47:36 (GMT)
commit33223ad729954a3a0cc0612eec9d645096f1589e (patch)
treeceec8475c64cb3d5fa4382b081d298acb92fef92
parent04d9f33941b3cf2bc1e21f92043d48b090579c85 (diff)
Issue #2248951 by eojthebrave: Missing documentation for block plugin annotations.
-rw-r--r--core/modules/block/lib/Drupal/block/Annotation/Block.php16
-rw-r--r--core/modules/block/lib/Drupal/block/Plugin/Type/BlockManager.php2
2 files changed, 17 insertions, 1 deletions
diff --git a/core/modules/block/lib/Drupal/block/Annotation/Block.php b/core/modules/block/lib/Drupal/block/Annotation/Block.php
index 64987e6..ec093be 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 bb76ec2..e6252eb 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']);
}
}