From 95ca7829f0085d560a71f4f91ec6c621c36245e5 Mon Sep 17 00:00:00 2001 From: Andy Heathershaw Date: Sat, 24 Oct 2020 14:09:08 +0100 Subject: [PATCH] Don't throw an exception if the TaxonomyFillListener hasn't been run --- src/Entity/Taxonomy.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Entity/Taxonomy.php b/src/Entity/Taxonomy.php index 1467f900a..8c0408f40 100644 --- a/src/Entity/Taxonomy.php +++ b/src/Entity/Taxonomy.php @@ -107,7 +107,7 @@ public function removeContent(Content $content): self public function getTaxonomyTypeSlug(): string { if ($this->getDefinition() === null) { - throw new \RuntimeException('Taxonomy not fully initialized'); + return $this->getType(); } return $this->getDefinition()->get('slug'); @@ -116,7 +116,7 @@ public function getTaxonomyTypeSlug(): string public function getTaxonomyTypeSingularSlug(): string { if ($this->getDefinition() === null) { - throw new \RuntimeException('Taxonomy not fully initialized'); + return $this->getType(); } return $this->getDefinition()->get('singular_slug');