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.
Using !pm_subject in the notification e-mail generates a linebreak <br />
. This gives some problems with themeing.
Comment | File | Size | Author |
---|---|---|---|
#5 | trim_subject_body.patch | 1.11 KB | Berdir |
Comments
Comment #1
BerdirConfirmed. This is because drupal_html_to_text() adds a "\n" to the end of the string.
So we need to add a trim() around that function call (for subject and maybe body too?) in http://blog.worldempire.ch/de/api/function/_pm_email_notify_token/1.
That's a quite simple change, can you create a patch? :)
Comment #2
Michsk CreditAttribution: Michsk commentedI could but never worked with .patch files so i will have to digg in to that first... If someone else can do it in the meanwhile that's ok.
Comment #3
Michsk CreditAttribution: Michsk commentedtrim() does do the job, but it looks pretty hard to create a patch file on a windows machine... i read some of the text here on drupal about patching but didnt find any usefull.
Ps; in my body messages i don't have the linebreak problem.
Comment #4
BerdirHave you seen http://drupal.org/node/60234?
Comment #5
BerdirAttaching an untested patch. Please test and set to RTBC if it's working.
The body doesn't need it, but it will add an additional empty line and that's imho not necessary. So adding the trim there too.
Comment #6
BerdirComment #8
BerdirWrong version, 1.1 doesn't pass the tests...
Comment #9
Berdir#5: trim_subject_body.patch queued for re-testing.
Comment #10
BerdirComment #11
BerdirCommited and fixed in all branches, thanks for reporting.
Comment #12
Michsk CreditAttribution: Michsk commentednp, sorry i couldn't help with creating the patch.