AwoDevelopment - Unleash the power of promotions!
AwoDevelopment
- Unleash the power of promotions!
awocoupon pro aworeferral awocoupon affiliate awocoupon email plugin
  • home
  • products
  • documentation
  • forum
  • contact us
  • faqs
Home » Blogs » seyi's blog

CCNewsletter Runtime Error in Internet Explorer

seyi — Fri, 05/28/2010 - 09:02

So I had a client who upgraded to CCNewsletter 1.0.7. His business is heavily reliant on newsletters and he is an avid internet explorer user. He tried to send a newsletter and the first batch worked fine. However, after the countdown, the interface freezes and a run time error is generated. This causes the rest of the batches fo fail. Here is the specific error:

Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; MDDC; .NET CLR 1.1.4322)
Timestamp: Wed, 26 May 2010 17:15:14 UTC

Message: Unknown runtime error
Line: 416
Char: 4
Code: 0
URI: .../administrator/index.php?option=com_ccnewsletter&controller=sendNewsletter&task=ccsend_all_first&id=18

Upon digging into the code, I found this to be a javascript problem for internet explorer. Firefox and most other browsers should work fine. The problem is that ccnewsletter is trying to write to the tbody of a table using innerHTML. That will not work in ie, as ie does not allow innerHTML on table tags. The only real solution is to use insertRow, insertCell, etc as per the dom requirements. This solution should work on all browsers.

In www/administrator/components/com_ccnewsletter/views/sendnewsletter/tmpl/ccsend.php
On or around line 76

document.getElementById('result_tbody').innerHTML += responseText;

Needs to be replaced with this:

//document.getElementById('result_tbody').innerHTML += responseText;
responseText = responseText.substr(21);
arData=responseText.match(/<td[^>]*>(.|\n)*?(?=<\/td>)/ig);
col = 0;
var myRow = null;
for(i=0,len=arData.length;i<len;i++) {
    if(col%3 == 0) myRow = document.getElementById('result_tbody').insertRow(-1);
    var myCell = myRow.insertCell(-1);
    if(col%3 != 1) myCell.style.textAlign = 'center';
    myCell.innerHTML = arData[i].replace(/<td[^>]*>/i,'');
    col++;
}
if(responseText.indexOf('<input id="stop" value="stop" type="hidden" />') != -1) {
    myRow = document.getElementById('result_tbody').insertRow(-1);
    var myCell = myRow.insertCell(-1);
    myCell.colSpan = arData.length;
    myCell.innerHTML = '<input id="stop" value="stop" type="hidden" />';
}
  • seyi's blog

Post new comment

The content of this field is kept private and will not be shown publicly.
Input format
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Web page addresses and e-mail addresses turn into links automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.

HI. Now i am getting this

Muthu (not verified) — Tue, 07/13/2010 - 15:06

HI.

Now i am getting this error

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; MDDC; InfoPath.3; .NET4.0C)
Timestamp: Tue, 13 Jul 2010 15:04:00 UTC

Message: Expected ')' in regular expression
Line: 299
Char: 51
Code: 0
URI: http://localhost/ccNewsletter/administrator/index.php?option=com_ccnewsl...

Message: Object expected
Line: 1
Char: 1
Code: 0
URI: http://localhost/ccNewsletter/administrator/index.php?option=com_ccnewsl...

  • reply

Yes, you are right, the page

seyi — Tue, 07/13/2010 - 18:34

Yes, you are right, the page was stripping out "\" characters. This has been fixed. The code should work now.

  • reply

Works ! , Thanks you very

Muthu (not verified) — Wed, 07/14/2010 - 05:10

Works ! , Thanks you very much

  • reply

Shopping cart

Loading cart

User login

  • Create new account
  • Request new password

Recent blog posts

  • Virtuemart Coupon Tax Error in Initial Basket
  • Sell Gift Certificates online in your Virtuemart Store
  • How to Improve Virtuemart Coupon Capabilities
  • Drupal/PhpMailer - Wrong "From" Name via Contact Form
  • CCNewsletter Runtime Error in Internet Explorer
  • Virtuemart Coupon Error with Discount Before Tax
  • Isapi Filter for Drupal Clean Urls
more
  • home
  • products
  • documentation
  • forum
  • contact us
  • faqs
© AwoDev.com All Rights Reserved     Privacy Policy · Terms and Conditions
payment methods