diff --git a/src/Controller/PardotController.php b/src/Controller/PardotController.php index 6e1b135..04db74e 100644 --- a/src/Controller/PardotController.php +++ b/src/Controller/PardotController.php @@ -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; } diff --git a/src/Provider/PardotShortCodeProvider.php b/src/Provider/PardotShortCodeProvider.php index f27bfa1..7b052ae 100644 --- a/src/Provider/PardotShortCodeProvider.php +++ b/src/Provider/PardotShortCodeProvider.php @@ -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;