Closed (fixed)
Project:
Mime Mail
Version:
6.x-1.0-alpha2
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 Feb 2009 at 15:28 UTC
Updated:
23 Oct 2010 at 18:03 UTC
I am reaciving this error:
warning: str_repeat() [function.str-repeat]: Second argument has to be greater than or equal to 0. in mysite.com/drupal/includes/mail.inc on line 480.
After updating to latest dev. minemail
Comments
Comment #1
jerdavisAre you getting this consistently? What version of simplenews?
Jer
Comment #2
Ed Ropple commentedI think (not 100%) that I'm encountering a similar issue with the latest -dev of mimemail and 6.x-1.0-rc6. Cron died every time it hit Simplenews and Simplenews tried to send a MIME-encoded email. Removing mimemail fixed the issue.
What do you need to know? I'll tell you what I can.
Comment #3
guru81 commentedI have the same error in crontab log.
Regards.
Comment #4
Ken Knowles commentedI had the same problem, and I found the solution to my situation.
I am using Simplenews, Mimemail, and WYSIWYG modules to create and send the newsletter. For WYSIWYG, I am using the TinyMCE 3 editor.
In my newsletter, I used the H1 tag for my header and then put a HR after that to create a separator. The editor wrapped the HR tag with another H1 tag since I hadn't changed the font size. The title had its own H1 tag and now the HR has its own H1 tag.
Somewhere along the way to the e-mailing of the newsletter, the HTML was changed so that only one H1 tag wrapped both the title and the HR tag. This created a long string for drupal_html_to_text (mail.inc) to work with. The function _drupal_html_to_text_pad (mail.inc) ended up with a zero pad but a prefix of 1 which was passed to str_repeat as -1 causing the error. Drupal_html_to_text may have caused the problem, but I have not researched that it combined the elements into one H1 tag.
I fixed this by going back to the newsletter and eliminating the H1 tags that wrapped the HR tag. The newsletter sent without a problem.
This error affects the plaintext version of the newsletter that is sent with the HTML version. The formatting for the plaintext version is incorrect when this error occurs. It still sends the content, but it is formatted incorrectly.
This may not be a Mimemail issue at all, since the problem may actually be occurring with the call to drupal_html_to_text. The way that drupal_html_to_text gets the chunks it processes uses regular expressions, so it may not be splitting the text correctly. Unfortunately, I'm not up-to-speed on regular expressions so I can't be sure it is doing it incorrectly. However, it could also be Mimemail since the malformed HTML ended up in the HTML mail as well, but it did not affect the rendering of the HTML.
Comment #5
keesje commentedI can confirm #4, I've seen this error with an H1 tag just containing some empty Apple spans with style rubbish.
Comment #6
jimyhuang commentedI also have this error like #4. After changed my <h2> tag in post, the error will solved. Seems core function drupal_html_to_text have some errors when process complex html.
Comment #7
terrychild commentedI've submitted a patch to core for this - http://drupal.org/node/508738
Comment #8
jeebsuk commentedI applied your patch and now my simplenews will not send :)
Comment #9
selinav commentedHello,
I have the same error message even if I send in plain-text format. I have the 6.x-1.0-alpha 1 version.
I have not < hr > tags and only one < h1 > tag.
What is the problem?
Thanks in advance
Comment #10
my-family commentedthe same problem, subscribe
Comment #11
seren10pity commentedsame problem, but I can't tell my clients so simplify their HTML... they don't even know what it is ^^
subscribing
Comment #12
-Mania- commentedI had the same problem although my source came from the views fields. I was combining 2 fields which I suppose made the string too long as described by Ken in #4.
Comment #13
sgabe commentedIt seems to be that this is not a Mime Mail issue.
Comment #14
sgabe commentedThis seems to be a core issue, which has been fixed by #508738: drupal_html_to_text negative padding error.