Skip to content

Commit

Permalink
Merge pull request #196 from BoltTranslate/hotfix/dont-break-when-tra…
Browse files Browse the repository at this point in the history
…nslation-missing

Don't break when missing translation encountered
  • Loading branch information
bobdenotter authored Jan 4, 2019
2 parents 3794f36 + ac1f466 commit e6fc44b
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 e6fc44b

Please sign in to comment.