See more in issue #195466: Drupal 6.9 and rc4 upgrade (this issue came up there) starting with comment #112; more details in #116 and #119.

Cheers.

CommentFileSizeAuthor
#3 simplenews-double-filter.patch538 bytesGarrett Albright

Comments

thomas23@drupal.org’s picture

Status: Active » Postponed (maintainer needs more info)
Garrett Albright’s picture

Found the problem!

I've got a meeting right now and don't have time to explain things thoroughly or roll a patch. Suffice it to say that check_markup() is being called twice because node_prepare() is being called twice and deleting the line

        $node = node_prepare($node);

from simplenews_mail() solves the problem.

Garrett Albright’s picture

StatusFileSize
new538 bytes

Okay, that meeting was shorter than expected. Here's the entirely unexciting patch, rolled against the latest dev release.

sutharsan’s picture

Status: Postponed (maintainer needs more info) » Active

I think calling node_prepare is fully valid. Plain text email should have this called.

Garrett Albright’s picture

It's being called twice, though. First by node_build_content(), and then again directly.

sutharsan’s picture

Agree, the problem is clear. But it is only called twice when simplenews and mimemail work together. When simplenews is used without mime mail is still needs node_prepare(). The next question is where is the right place to solve this. I am still not sure why mime mail needs to filter the email content.

Garrett Albright’s picture

I don't see anything which is causing either node_build_content() or node_prepare() to only be called when Mime Mail is installed, though. This bug is totally independent of Mime Mail's presence.

luti’s picture

It seems everything works fine if I send HTML. When sending PLAIN, linebreaks are not present, so everything seems to be one big paragraph...

I have Simplenews 6.x-1.x-dev version from 2008-Sep-02 with above patch #3 and simplenews-mimemail.patch (issue Restore Mime Mail support in D6 / #3) applied

Mimemail itself is the mimemail-6.x-0.9.tar_.gz version (issue Upgrade Mime Mail to Drupal 6 / #102), with a mimemail-no-alter.patch (issue Upgrade Mime Mail to Drupal 6 / #125) applied.

I have the impression there is a quite big confusion with versions and patches applied to them - so we have many times more or less different code installed, but discuss about the same... It would be nice to have both Simplenews as well as Mime Mail (at least alpha-x) versions available, to be able to refer to some particular version when describing some issue (as above)...

thomas23@drupal.org’s picture

I agree with LUTi! In addition, even though I haven't tested (still no time :( ) my guess would be that patch #3 wouldn't solve the paragraph issue on my end. I only have simplenews installed. If I understand everything well from this diskussion node_prepare() is only called twice with mime mail installed (which I haven't and still acknowledge the paragraph issue).

Still trying to get to the source ;) (trying to find some time to digg in). Cheers.

Garrett Albright’s picture

My latest patch for Simplenews should fix the problem with line endings being clobbered in plain text versions of messages being sent with Mime Mail. thomas, if this is happening without Mime Mail, sorry, but I'm not going to be the one to fix it.

sutharsan’s picture

Status: Active » Fixed

I finally had the time to test this and now I understand the fault. In simplenews_mail() check_markup() is first called by node_build_content() and next by node_prepare(). But that's what Garret said all the time ;)
Patch committed. Thanks!

Anonymous’s picture

Status: Fixed » Closed (fixed)

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