From a209d3c1ca4ad248a43210d724f0106ebe428794 Mon Sep 17 00:00:00 2001 From: dannylamb Date: Mon, 18 Mar 2019 16:20:18 -0300 Subject: [PATCH] Adding media to the EntityBundle condition (#123) --- src/Plugin/Condition/EntityBundle.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Plugin/Condition/EntityBundle.php b/src/Plugin/Condition/EntityBundle.php index 96fa76d1..77cf2826 100644 --- a/src/Plugin/Condition/EntityBundle.php +++ b/src/Plugin/Condition/EntityBundle.php @@ -13,6 +13,7 @@ use Drupal\Core\Form\FormStateInterface; * label = @Translation("Entity Bundle"), * context = { * "node" = @ContextDefinition("entity:node", required = FALSE, label = @Translation("Node")), + * "media" = @ContextDefinition("entity:media", required = FALSE, label = @Translation("Media")), * "taxonomy_term" = @ContextDefinition("entity:taxonomy_term", required = FALSE, label = @Translation("Term")) * } * ) @@ -24,7 +25,7 @@ class EntityBundle extends ConditionPluginBase { */ public function buildConfigurationForm(array $form, FormStateInterface $form_state) { $options = []; - foreach (['node', 'taxonomy_term'] as $content_entity) { + foreach (['node', 'media', 'taxonomy_term'] as $content_entity) { $bundles = \Drupal::service('entity_type.bundle.info')->getBundleInfo($content_entity); foreach ($bundles as $bundle => $bundle_properties) { $options[$bundle] = $this->t('@bundle (@type)', [