Unverified Commit 74efb5b5 authored by logickal's avatar logickal Committed by Mateu Aguiló Bosch

fix(Dependencies): JsonApiResourceConfig entities are orphaned when associated...

fix(Dependencies): JsonApiResourceConfig entities are orphaned when associated Entity Type/Bundle deleted (#2903432 by logickal)
parent 79128a7a
...@@ -78,4 +78,14 @@ class JsonapiResourceConfig extends ConfigEntityBase { ...@@ -78,4 +78,14 @@ class JsonapiResourceConfig extends ConfigEntityBase {
\Drupal::service('router.builder')->setRebuildNeeded(); \Drupal::service('router.builder')->setRebuildNeeded();
} }
/**
* {@inheritdoc}
*/
public function calculateDependencies() {
parent::calculateDependencies();
$id = explode('--',$this->id);
$typeManager = $this->entityTypeManager();
$dependency = $typeManager->getDefinition($id[0])->getBundleConfigDependency($id[1]);
$this->addDependency('config', $dependency['name']);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment