Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#2 | mime_mail_get_enabled_languages-2790803-2.patch | 1.14 KB | meramo |
Comments
Comment #2
meramo CreditAttribution: meramo at Bright Solutions GmbH commentedMade 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.
Comment #3
DamienMcKennaThanks for the patch.
PS, don't forget to set the status to "needs review" when you upload a patch.
Comment #5
TR CreditAttribution: TR commentedThat 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?
Comment #6
TR CreditAttribution: TR commentedAs 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.