Skip to content

Commit

Permalink
Don't break when missing translation encountered
Browse files Browse the repository at this point in the history
  • Loading branch information
bobdenotter committed Jan 4, 2019
1 parent 3794f36 commit ac1f466
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ composer.lock
vendor/
tests/tmp/
.couscous
.idea/
6 changes: 6 additions & 0 deletions src/EventListener/StorageListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit ac1f466

Please sign in to comment.