From 597d9b0b0085997a2abd824561cdb847f4b8885f Mon Sep 17 00:00:00 2001 From: Joshua Schumacher Date: Tue, 30 Mar 2021 15:16:14 +0200 Subject: [PATCH] Fixed a bug where the translation data was not saved if the slug did not match the generated slug --- src/EventListener/StorageListener.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/EventListener/StorageListener.php b/src/EventListener/StorageListener.php index 63c3072..8ec6388 100644 --- a/src/EventListener/StorageListener.php +++ b/src/EventListener/StorageListener.php @@ -186,7 +186,8 @@ public function preSave(StorageEvent $event) return; } - $contentType = $this->boltConfig->get('contenttypes/' . $event->getContentType()); + $subject = $event->getSubject(); + $contentType = $this->boltConfig->get('contenttypes/' . $subject->getContentType()); if ($contentType === null) { return; @@ -214,7 +215,7 @@ public function preSave(StorageEvent $event) if ($values['id']) { /** @var Content $defaultContent */ $defaultContent = $this->query->getContent( - $event->getContentType(), + $subject->getContentType(), ['id' => $values['id'], 'returnsingle' => true] ); }