Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / views / src / Plugin / views / argument_validator / Entity.php
index 896d24bf64c994941ae30bad661e12992f53d981..befbbe7c26fe3c9ff6182d8a1e91e065d6bf967b 100644 (file)
@@ -5,7 +5,7 @@ namespace Drupal\views\Plugin\views\argument_validator;
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Core\Form\FormStateInterface;
-use Drupal\Core\Plugin\Context\ContextDefinition;
+use Drupal\Core\Plugin\Context\EntityContextDefinition;
 use Drupal\views\Plugin\views\argument\ArgumentPluginBase;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -233,7 +233,9 @@ class Entity extends ArgumentValidatorPluginBase {
    * {@inheritdoc}
    */
   public function getContextDefinition() {
-    return new ContextDefinition('entity:' . $this->definition['entity_type'], $this->argument->adminLabel(), FALSE);
+    return EntityContextDefinition::fromEntityTypeId($this->definition['entity_type'])
+      ->setLabel($this->argument->adminLabel())
+      ->setRequired(FALSE);
   }
 
 }