Just for someone who searches for it.

Notice: Undefined offset: 1 in Drupal\mimemail\Utility\MimeMailFormatHelper::mimeMailUrl() (line 348 of modules/contrib/mimemail/src/Utility/MimeMailFormatHelper.php).
Drupal\mimemail\Utility\MimeMailFormatHelper::mimeMailUrl('/user/password?WerberNummer=34234') (Line: 571)
Drupal\mimemail\Utility\MimeMailFormatHelper::expandLinks(Array)

When sending an email got the warning above.

Problematic code is in \Drupal\mimemail\Utility\MimeMailFormatHelper::mimeMailUrl

// Get a list of enabled languages.
$languages = \Drupal::languageManager()->getLanguages('enabled');
$languages = $languages[1];

The \Drupal\Core\Language\LanguageManagerInterface::getLanguages method does not accept "enabled" as the argument, it waits for an integer flag instead, so the list of languages is never returned and warnings follow afterwards.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

meramo created an issue. See original summary.

meramo’s picture

Made an attempt to fix with this short patch.
Another point is that whole block searching for prefix and stripping it from the path is not needed at all IMHO, as we're building the full link for the plain text message here. Contributions and thoughts are welcome.

DamienMcKenna’s picture

Status: Active » Needs review

Thanks for the patch.

PS, don't forget to set the status to "needs review" when you upload a patch.

Status: Needs review » Needs work

The last submitted patch, 2: mime_mail_get_enabled_languages-2790803-2.patch, failed testing. View results

TR’s picture

Status: Needs work » Postponed (maintainer needs more info)

That piece of code that the patch modifies has changed a bit since the patch was first posted. See #2807645: Handle languages correctly when generating links

Is this still broken in the current version of Mime Mail?

TR’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

As I said in #5, that piece of code has been changed since your first bug report. Specifically, Mime Mail no longer uses the call to getLanguages('enabled') which you said was the cause of the problem.

Feel free to reopen the issue if this is still a problem with the current -dev version of Mime Mail.