Skip to content

Commit

Permalink
add check if request exist
Browse files Browse the repository at this point in the history
  • Loading branch information
koertho committed Jun 30, 2022
1 parent cdf1198 commit c8975ad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@

All notable changes to this project will be documented in this file.

## [1.23.4] - 2022-06-30
- Fixed: issue on sending messages with notification center queue

## [1.23.3] - 2022-06-30
- Fixed: empty host in optInUrl in some cases
- Fixed: empty host in optInUrl in some cases
- Fixed: warning in Tokens

## [1.23.2] - 2022-06-28
Expand Down
5 changes: 4 additions & 1 deletion classes/EventListener/FormGeneratorListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,10 @@ public function onSendNotificationMessage(Message $message, array &$tokens, ?str
}

if (version_compare(VERSION, '4.7', '>=')) {
if (($tokens['formconfig_huhSubAddOptIn'] ?? false) && isset($tokens['formconfig_optInIdentifier'])) {
if (($tokens['formconfig_huhSubAddOptIn'] ?? false)
&& isset($tokens['formconfig_optInIdentifier'])
&& System::getContainer()->get('request_stack')->getCurrentRequest()
) {
$base = System::getContainer()->get('request_stack')->getCurrentRequest()->getSchemeAndHttpHost();
$tokens['optInToken'] = $tokens['formconfig_optInIdentifier'];
$tokens['optInUrl'] = $base.'?token='.$tokens['formconfig_optInIdentifier'];
Expand Down

0 comments on commit c8975ad

Please sign in to comment.