diff --git a/.gitignore b/.gitignore index ba9fa4a..44e0f09 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ composer.lock vendor/ tests/tmp/ .couscous +.idea/ diff --git a/src/EventListener/StorageListener.php b/src/EventListener/StorageListener.php index efe7e4e..e9cdc4b 100644 --- a/src/EventListener/StorageListener.php +++ b/src/EventListener/StorageListener.php @@ -136,7 +136,13 @@ public function postHydrate(HydrationEvent $event) if (!isset($subject[$localeSlug . 'data'])) { return; } + $localeData = json_decode($subject[$localeSlug . 'data'], true); + + if (empty($localeData)) { + return; + } + foreach ($localeData as $key => $value) { if ($key === 'templatefields' && !($subject['template'] === null && !isset($contentType['record_template']))) { if (isset($subject['template']) && $subject['template'] === null) {