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

jerdavis’s picture

Status: Active » Postponed (maintainer needs more info)

Are you getting this consistently? What version of simplenews?

Jer

Ed Ropple’s picture

Status: Postponed (maintainer needs more info) » Active

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

guru81’s picture

I have the same error in crontab log.

Regards.

Ken Knowles’s picture

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

keesje’s picture

I can confirm #4, I've seen this error with an H1 tag just containing some empty Apple spans with style rubbish.

jimyhuang’s picture

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

terrychild’s picture

I've submitted a patch to core for this - http://drupal.org/node/508738

jeebsuk’s picture

I applied your patch and now my simplenews will not send :)

selinav’s picture

Hello,

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

my-family’s picture

the same problem, subscribe

seren10pity’s picture

same problem, but I can't tell my clients so simplify their HTML... they don't even know what it is ^^

subscribing

-Mania-’s picture

Version: 6.x-1.x-dev » 6.x-1.0-alpha2

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

sgabe’s picture

It seems to be that this is not a Mime Mail issue.

sgabe’s picture

Title: New error sending simplenews after updating to latest dev. minemail » Negative padding error in drupal_html_to_text
Status: Active » Closed (fixed)

This seems to be a core issue, which has been fixed by #508738: drupal_html_to_text negative padding error.