Using !pm_subject in the notification e-mail generates a linebreak <br />. This gives some problems with themeing.

CommentFileSizeAuthor
#5 trim_subject_body.patch1.11 KBBerdir
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Berdir’s picture

Confirmed. 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? :)

Michsk’s picture

I 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.

Michsk’s picture

trim() 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.

Berdir’s picture

Berdir’s picture

FileSize
1.11 KB

Attaching 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.

Berdir’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, trim_subject_body.patch, failed testing.

Berdir’s picture

Version: 6.x-1.1 » 6.x-1.x-dev

Wrong version, 1.1 doesn't pass the tests...

Berdir’s picture

Status: Needs work » Needs review

#5: trim_subject_body.patch queued for re-testing.

Berdir’s picture

Title: !pm_subject generatesw automaticly linebreak » !pm_subject adds linebreak
Berdir’s picture

Status: Needs review » Fixed

Commited and fixed in all branches, thanks for reporting.

Michsk’s picture

np, sorry i couldn't help with creating the patch.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.