Skip to content

Commit

Permalink
Merge pull request #3 from Cyber-Duck/feature/bug_fix
Browse files Browse the repository at this point in the history
Fixed the cache bug
  • Loading branch information
waiyanhein authored Jul 2, 2019
2 parents c9695fb + e0a2cd0 commit 18590aa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Controller/PardotController.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ private function getDynamicContent()
]));
}
$contentList = $contents->Sort('Title')->map();
$cache->set(self::$DYNAMIC_CONTENTS_CACHE_KEY, serialize($formList), static::getCacheDuration());
$cache->set(self::$DYNAMIC_CONTENTS_CACHE_KEY, serialize($contentList), static::getCacheDuration());

return $contentList;
}
Expand Down
3 changes: 2 additions & 1 deletion src/Provider/PardotShortCodeProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ public static function PardotForm($arguments, $content, $parser, $shortcode, $ex
$form = unserialize($cache->get(self::formCacheKey($arguments['id'])));
}


if (! $form) {
$form = PardotApiService::getApi()->form()->read($arguments['id']);
$cache->set(self::formCacheKey($arguments['id']), serialize($content), static::getCacheDuration());
$cache->set(self::formCacheKey($arguments['id']), serialize($form), static::getCacheDuration());
}

$code = $form->embedCode;
Expand Down

0 comments on commit 18590aa

Please sign in to comment.