Illegal offset type in Drupal\mailjet\Form\DomainSettingsForm->buildForm() . Trusted domains tab has no effect

Created on 21 March 2023, over 1 year ago
Updated 27 March 2023, over 1 year ago

Problem/Motivation

I clicked on add domain
added my domain without http/https
it saved
directions in the green box came up
no domains were added to the list

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Needs work

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States SocialNicheGuru

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @SocialNicheGuru
  • πŸ‡ΊπŸ‡ΈUnited States SocialNicheGuru

    Error in logs:
    Warning: Illegal offset type in Drupal\mailjet\Form\DomainSettingsForm->buildForm() (line 55 of /mysite/html/modules/contrib/mailjet/src/Form/DomainSettingsForm.php)

  • Status changed to Needs work over 1 year ago
  • πŸ‡ΊπŸ‡¦Ukraine abramm Lutsk

    Here is the code that seems to be causing an issue:

        if ($domains = mailjet_user_domain_list()) {
          foreach ($domains as $domain) {
            if (!is_string($domain['Email'])) {
              $email = $domain['Email']['Email'];
            }
            else {
              $email = $domain['Email'];
            }
            $options[$email] = [
              'domain' => str_replace('*@', '', $email),
              'enabled' => $domain['Status'],
              'file_name' => $domain['Filename'],
            ];
          }
        }
    

    Most likely the $email variable doesn't have any value.

Production build 0.71.5 2024