New error sending simplenews after updating to latest dev. minemail

jgarabot - February 27, 2009 - 15:28
Project:Mime Mail
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

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

#1

jerdavis - March 3, 2009 - 04:03
Status:active» postponed (maintainer needs more info)

Are you getting this consistently? What version of simplenews?

Jer

#2

Ed Ropple - March 18, 2009 - 17:11
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.

#3

guru81 - April 16, 2009 - 14:25

I have the same error in crontab log.

Regards.

#4

Ken Knowles - April 23, 2009 - 18:05

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.

#5

kees@qrios - June 3, 2009 - 14:34

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

#6

jimyhuang - June 21, 2009 - 05:24

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.

#7

terrychild - July 6, 2009 - 23:18

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

#8

JeebsUK - September 17, 2009 - 08:13

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

#9

selinav - December 7, 2009 - 17:03

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

 
 

Drupal is a registered trademark of Dries Buytaert.