diff --git a/CHANGELOG.md b/CHANGELOG.md index 2720a404..e5fcd4e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -251,7 +251,12 @@ - `Field::name` attribute has been deprecated. Use `Field::label` instead. - `Field::inputHtml()` method has been deprecated. Use `Field::cpInputHtml()` instead. -## 2.1.27 - 2024-08-14 +## 2.1.28 - 2024-08-29 + +### Fixed +- Fixed an error when parsing variable tokens. + +## 2.1.27 - 2024-08-29 ### Added - Added “Page URI” and “Page Name” to HubSpot integration for Forms. diff --git a/src/helpers/Variables.php b/src/helpers/Variables.php index d294f611..d5c7460f 100644 --- a/src/helpers/Variables.php +++ b/src/helpers/Variables.php @@ -154,9 +154,9 @@ public static function getParsedValue(mixed $value, Submission $submission = nul // This helps to only cache it per-submission, when being run in queues. $cacheKey = mt_rand(); - if ($submission->id) { + if ($submission && $submission->id) { $cacheKey = 'submission' . $submission->id; - } else if ($form->id) { + } else if ($form && $form->id) { $cacheKey = 'form' . $form->id; }