Closed (fixed)
Project:
Mime Mail
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
29 Mar 2009 at 16:44 UTC
Updated:
3 Jul 2014 at 10:10 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
plachThe attached patch should solve the issuo by comparing the first path segment with all the enabled languages' prefixes.
Comment #2
Hobbes-2 commentedSame problem, the patch is working perfecly, thanks
Comment #3
Hobbes-2 commentedIs it possible to patch the next version of mimemail with this patch ?
Comment #4
sgabe commentedI have tested this patch and looks fine for me, but I wonder if there is a better solution for this than string manipulation? Would be appreciated if somebody could confirm this.
Comment #5
plachUnfortunately in D6 there is no API function to extract the language prefix from a path. If you check http://api.drupal.org/api/function/language_initialize/6 you will see that the string manipulation above mimics closely the one performed to get the current language prefix during the language negotiation process.
Comment #6
luksakhi
this patch doesn't work anymore. could someone write a new one?
and maybe this should be committed since multilingual websites also send e-mails...
thanks
lukas
Comment #7
luksaki have written a patch myself. please let me know if anything is wrong since this one of my first ones.
Comment #8
sgabe commented@elluca: Thanks for the patch!
Note that you should use the project root directory, otherwise the patch doesn't apply. See the Creating patches page in the handbook.
Furthermore you missed to pass the prefix to the url() call.
@plach: Some thoughts about your patch.
I would change the $path_segments to $args which is shorter and good enough, but that's minor.
Split this and get just the enabled languages apart, so it will be usable in the url() call.
Furthermore here we can check against the array keys.
Move the prefix to the end of the array, so the modification will be unambiguous.
However I did some additional testing with this and the patch needed some work:
ennode/1, so a trailing slash should be added to the end of the prefix.I am attaching a revised patch with these modifications.
Comment #9
sgabe commentedComment #10
luksakthanks for pointing that out, i was thinking this can't be right.
for me, your revised patch doesnt work while mine does. it removes the prefix.
Comment #11
sgabe commentedSee, that is why this isn't committed yet. ;)
How did I test:
/node/1and/hu/loremipsumand/de/node/3)The results seemed fine. How did you test it? Can you give more information how to reproduce?
Comment #12
luksaki am sorry, mine doesn't work either :)
i use the cck link field and it is being rendered by a view, but i guess this doesn't matter.
i use simplenews and when i did test earlier today, i used "send test newsletter". i did this with the backend in the same language as the mail. but since simplenews newsletters are being sent via cron, this is not the case. so this is a special use case we would have to take into account.
ideas?
thanks
Comment #13
sgabe commentedSeems like this needs work, then.
Comment #14
luksakhave you got an idea how i could find out if it is a simplenews mail?
Comment #15
sgabe commentedI am not sure that I understand your question right.
Comment #16
luksakif we can check inside _mimemail_url() if we are sending a mail for simplenews. and if we do, get the node language and modify the language variable according to that.
Comment #17
sgabe commentedThat is not good for us, we need a general solution irrespectively of the origin of the message.
Comment #18
luksakhi sgabe
what do you think, how much time will it take to fix this issue? you want to take a generic approach?
thanks
lukas
Comment #19
mastermint commentedFirst, sorry for my bad english...
I have no solution patch, but another way to afford this job (sendind newsletters in MULTI-Languaje drupal enviroment) with EXCELLENT results and correct "PATHS", cause I've had the same problem with languaje prefix, so I made this things:
I've created alias server for each languaje (Apache configuration) i.e.: http://es.example.com, http://en.example.com and http://cat.example.com for languajes Spanish, English and Catalan.
All subservers pointing the same root directory (/var/www)
Then, I changed the LANGUAJE settings (/admin/settings/language/configure) from "Path prefix with language fallback" to "Domain name only" and edited every languaje setting individually to point its own name server with the option "Language-specific URL, with protocol" (VERY important to write the http:// statement too) in "/admin/settings/language/edit/en", es, ca, etc...
It does NOT solve the problem in the module, but you can start sending newsletters and mails with correct paths in all links.
Good luck solving programatic way, I'm waiting for a solution too.
Comment #20
YK85 commentedsubscribing
Comment #21
eric.chenchao commentedHi all, I have encountered the same issue and I use mimemail and simplenews to send newsletter. When views inserted in a node is dynamically generate content, the mimemail module will convert relative links into absolute links and then send the mail to subscribers.
My point is all the relative links included within the content are created properly and work well in the scope of website. Maybe we should just add a base url to get the full path.
I promise I will go to learn how to use patch next time;)
Comment #22
polThe patch in #8 is working with 6.x-1.0-beta2.
Here is the patch for 6.x-1.x-dev.
Thanks !
Comment #23
polAnd this is the same patch for 6.x-1.0-beta2.
Comment #24
sgabe commentedThe attached patch works for me perfectly. Committed to D6.
Comment #25
polHello Sgabe,
Please, include authoring informations (found on the user profile) when you commit, so we can see on our profile that we worked on the module.
For this patch, you should have include the plach authoring informations:
--author="plach <plach@183211.no-reply.drupal.org>"This parameter must be added to the commit line.
Thanks.
Comment #26
chicodasilva commentedPatch on #24 needs to have some modifications for D7 for languages in which prefix is different of language definition (ex: pt-pt with prefix 'pt').
Comment #27
sgabe commentedWould you provide a patch?
Comment #28
sgabe commentedThis seems to do the rick on D7.
Comment #29
khumbu commentedDid a quick test and path seems to work for D7. Will provide better test results in a few days.
Anyway thx for thre great work...
edit:
Tested the patch on a 2 language dev site (drupal 7.9), using simplenews (7.x-1.0-alpha1), mimemail (7.x-1.x-dev)and simplenews content selection (simplenews_content_selection-7.x-1.x-dev.tar_.gz).
Everything works for now
Comment #30
sgabe commentedCommitted to D7. Thank you for testing, Khumbu!
Comment #32
tobiasbHouston we have a problem, there is a bug. ;-)
In case you have a path like
/en/drupal, then the explode('/', $args) build the following array.Therefore the check if $args[0] can not work.
I added a patch which fix this use case.
Comment #33
sgabe commented#32 is moved to #2297135: Language prefix with absolute-path reference.