Posted by domidc on April 27, 2009 at 10:10am
Jump to:
| Project: | Mime Mail |
| Version: | 6.x-1.0-alpha6 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (duplicate) |
Issue Summary
I discovered this flaw in the mimemail module when working with send module in a multilingual site.
In the mimemail.module the function mimemail_html_body() gets called which you ll find in the mimemail.inc file.
Here in the preg_replace _mimemail_url() gets called which will format all your urls in the mail.
But what happens is that the when you have a node http://yoursite.com/fr/node/7 the url gets transformed to http://yoursite.com/fr/fr/node/7
Quick fix: Patch the module and put on line 518 before the url() function:
$languages = array('nl', 'fr', 'de');//all languages
foreach ($languages as $lang) {
$path = str_replace($lang, '', $path);
}Real fix:
Multilingual support in the mimemail module. Should be taken into account where the replace gets called on line 300 in mimemail.inc
Comments
#1
thank you for this quick patch
I had the same problem with a multilingual site and i tested the quick solution with small change
$languages = array('es/', 'en/');//all languages
foreach ($languages as $lang) {
$path = str_replace($lang, '', $path);
}
because without the "/" the patch replace others words in the path like "destination" by "dtination"
thanks
#2
Same problem here with 6.x-1.0-alpha2
/fr/fr , /en/en in email
#3
Duplicate of #417462: Language prefix is not taken into account.
#4
this is still a problem with this module.
I improved a little bit more this quick patch. With this last version still causes conflicts, for example:
es/es/novedades/node21
become a broken url:
es/novedad/node21
my quick solution with regexp (it only removes lang code at the begining of the url):
$path = preg_replace('/^ca\/|^es\//', '', $path);#5
This issue is a duplicate. Please post your thoughts and findings in the original issue here: #417462: Language prefix is not taken into account