diff --git a/src/Entity/PathautoPattern.php b/src/Entity/PathautoPattern.php
index f7619e8..6370ddd 100644
--- a/src/Entity/PathautoPattern.php
+++ b/src/Entity/PathautoPattern.php
@@ -140,13 +140,8 @@ class PathautoPattern extends ConfigEntityBase implements PathautoPatternInterfa
     }
     $this->selection_criteria = $criteria;
 
-    /** @var \Drupal\Core\Plugin\Context\ContextInterface[] $contexts */
-    $contexts = $this->getContexts();
-    foreach ($this->getAliasType()->getContexts() as $plugin_context_id => $plugin_context) {
-      unset($contexts[$plugin_context_id]);
-    }
     $this->context_definitions = [];
-    foreach ($contexts as $context_id => $context) {
+    foreach ($this->contexts as $context_id => $context) {
       $this->context_definitions[] = [
         'id' => $context_id,
         'label' => $context->getContextDefinition()->getLabel()
