Skip to content

Commit

Permalink
Merge pull request #17 from georgringer/patch-3
Browse files Browse the repository at this point in the history
[BUGFIX] Fix notices in ReceiverMailReceiverPropertiesService
  • Loading branch information
mschwemer authored Mar 18, 2022
2 parents 07df997 + 5cbe571 commit 44843d9
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,11 @@ public function getReceiverName(): string
protected function setReceiverEmails(): void
{
$emailArray = $this->getEmailsFromFlexForm();
$emailArray = $this->getEmailsFromFeGroup($emailArray, (int)$this->settings['receiver']['fe_group']);
$emailArray = $this->getEmailsFromBeGroup($emailArray, (int)$this->settings['receiver']['be_group']);
$emailArray = $this->getEmailsFromFeGroup($emailArray, (int)($this->settings['receiver']['fe_group'] ?? 0));
$emailArray = $this->getEmailsFromBeGroup($emailArray, (int)($this->settings['receiver']['be_group'] ?? 0));
$emailArray = $this->getEmailsFromPredefinedEmail(
$emailArray,
(string)$this->settings['receiver']['predefinedemail']
(string)($this->settings['receiver']['predefinedemail'] ?? '')
);
$emailArray = $this->overWriteEmailsWithTypoScript($emailArray);
$emailArray = $this->getEmailFromDevelopmentContext($emailArray);
Expand All @@ -140,7 +140,7 @@ protected function setReceiverEmails(): void
*/
protected function getEmailsFromFlexForm(): array
{
if ((int)$this->settings['receiver']['type'] === self::RECEIVERS_DEFAULT) {
if ((int)($this->settings['receiver']['type'] ?? 0) === self::RECEIVERS_DEFAULT) {
$mailRepository = ObjectUtility::getObjectManager()->get(MailRepository::class);
$emailString = TemplateUtility::fluidParseString(
$this->settings['receiver']['email'],
Expand All @@ -161,7 +161,7 @@ protected function getEmailsFromFlexForm(): array
*/
protected function getEmailsFromFeGroup(array $emailArray, int $uid): array
{
if ((int)$this->settings['receiver']['type'] === self::RECEIVERS_FRONTENDGROUP && !empty($uid)) {
if ((int)($this->settings['receiver']['type'] ?? 0) === self::RECEIVERS_FRONTENDGROUP && !empty($uid)) {
$userRepository = ObjectUtility::getObjectManager()->get(UserRepository::class);
$users = $userRepository->findByUsergroup($uid);
$emailArray = [];
Expand All @@ -186,7 +186,7 @@ protected function getEmailsFromFeGroup(array $emailArray, int $uid): array
*/
protected function getEmailsFromBeGroup(array $emailArray, int $uid): array
{
if ((int)$this->settings['receiver']['type'] === self::RECEIVERS_BACKENDGROUP && !empty($uid)) {
if ((int)($this->settings['receiver']['type'] ?? 0) === self::RECEIVERS_BACKENDGROUP && !empty($uid)) {
/** @var BackendUserRepository $beUserRepository */
$beUserRepository = ObjectUtility::getObjectManager()->get(BackendUserRepository::class);
$query = $beUserRepository->createQuery();
Expand Down Expand Up @@ -217,7 +217,7 @@ protected function getEmailsFromBeGroup(array $emailArray, int $uid): array
*/
protected function getEmailsFromPredefinedEmail(array $emailArray, string $predefinedString): array
{
if ((int)$this->settings['receiver']['type'] === self::RECEIVERS_PREDEFINED && !empty($predefinedString)) {
if ((int)($this->settings['receiver']['type'] ?? 0) === self::RECEIVERS_PREDEFINED && !empty($predefinedString)) {
$receiverString = TypoScriptUtility::overwriteValueFromTypoScript(
'',
$this->configuration['receiver.']['predefinedReceiver.'][$predefinedString . '.'],
Expand Down

0 comments on commit 44843d9

Please sign in to comment.