From 091c06b23b42cc3b65a462ff432617a9abe9ca05 Mon Sep 17 00:00:00 2001 From: Svante Richter Date: Wed, 3 Aug 2016 20:58:15 +0200 Subject: [PATCH] Fix issue mentioned in #51 See https://github.com/AnimalDesign/bolt-translate/pull/51#issuecomment-237335226 --- src/EventListener/StorageListener.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/EventListener/StorageListener.php b/src/EventListener/StorageListener.php index 0b98a64..1c89a6d 100644 --- a/src/EventListener/StorageListener.php +++ b/src/EventListener/StorageListener.php @@ -167,7 +167,8 @@ public function preSave(StorageEvent $event) $localeSlug = $request->get('_locale'); $record->set($localeSlug . '_slug', $values['slug']); - if ($values['_locale'] == reset($this->config->getLocales())->getSlug()) { + $locales = $this->config->getLocales(); + if ($values['_locale'] == reset($locales)->getSlug()) { $record->set($localeSlug . '_data', '[]'); return; }