Closed (fixed)
Project:
Simplenews
Version:
7.x-1.0-alpha2
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Issue tags:
Reporter:
Created:
25 Dec 2011 at 21:40 UTC
Updated:
19 Jan 2012 at 22:41 UTC
Jump to comment: Most recent file
Comments
Comment #1
silberling commentedAfter some debugging I found a line that seems to cause the issue (I'm afraid I don't have a dev environment setup so no patch):
simplenews.module:
I removed the . (dot) in front of the equal sign, and the double up vanishes:
Comment #2
miro_dietikerThis really seems to be wrong to me.
However let's see why the tests didn't show this issue.
Comment #3
berdirBecause there is no test assertion to check if something is shown twice in the mail body :) Tests' don't magically discover bugs, they only check what you could think of while writing them. I also haven't noticed this while printing the mails to write test assertions for them. So maybe this only occurs in a configuration that don't have any test for yet. (You have to keep in mind that our test suite is still very basic, there are lots of combinations which aren't tested yet, including having any other fields that the default body one on any newsletter node).
That's how tests evolve, you write a few, someone reports a bug which is not covered yet, you add another test case or just a simple assertion to check this as well and you can then be pretty certain that this regression won't happen again (only pretty certain because the test can have bugs too).
Also, I've never touched that function as you can see from the blame log, so I also never wrote any tests for it:
(in fact, the whole function is from the same commit back in 2010-02-24).
This leads to the conclusion that, while this line is clearly wrong, the occurence of this bug must have been triggered by something else.
Will take a closer look in the next days.
Comment #4
miro_dietiker:-) Adding tag for test candidate. ;-)
Comment #5
berdirNote that the common tag for this is "needs tests". "test candidate" is something that I used specifically when preparing for our testing workshop.
Comment #6
miro_dietikerI just adopted your pattern. Feel free to update the issues. Also there was a typo in the original version and i needed around 5 issues to finally realize the tagname is wrong. ;-)
http://drupal.org/project/issues/search/simplenews?issue_tags=test%20can...
Comment #7
extrarumeno commentedsubscribe
Comment #8
berdirOk, attaching a patch with the fix including tests.
We didn't have any tests for sending HTML mails from actual nodes yet, only a basic one with a custom source implementation. That's why this bug wasn't found. I am not sure why it didn't happen with alpha1 though.
Also fixed another bug in the format override handling and explicitly pass the format to the footer template instead of getting in the preprocess function from the category to allow to override it.
Also added a custom MailSystem implementation used for testing that doesn't convert HTML to text.
Comment #9
miro_dietikerLooks pretty fine. Great job, thank you. (Reviewed by reading code.)
Comment #10
berdirOk, commited!
Comment #12
mastap commentedI get the following when applying the patch:
any clue? thanks!
Comment #13
berdirYou don't need to apply this patch.
Just download the dev snapshot (you can switch back to the beta version once released) and you should be good to go.