Jump to content
Devendra1203

error parameter to is corrupted prestashop

Recommended Posts

Hi,

 

Am using PS 1.6.1.4

 

Till yesterday mail was working fine. But now facing a weird issue.

 

Whenever trying to update order status facing "error parameter to is corrupted"

 

Also mails are not going to client after order success.

 

Please Help.

Edited by Devendra1203 (see edit history)

Share this post


Link to post
Share on other sites

it looks like it is problem related to mailing, parameter "to" is an email of customer, or email of shop admin (if it receive an order confirmation with mail alerts module).

Is the email correct? Both customer email and shop email ?

Share this post


Link to post
Share on other sites

I would try with an own test customer, create an order and check all important order stats. You should then  receive the emails for your test customer. I'd assume you won't get these because the corresponding function usually aborts when the corrupted message appears.

Edited by Scully (see edit history)

Share this post


Link to post
Share on other sites

it looks like it is problem related to mailing, parameter "to" is an email of customer, or email of shop admin (if it receive an order confirmation with mail alerts module).

Is the email correct? Both customer email and shop email ?

@vekia,

 

The problem is definitely with mailing i think or with code.

 

Yesterday I have migrated this site to GoDaddy VPS Linux hosting. But order mail was working properly today morning. and also now Test Mail from "Advanced Parameters > Email" is also sending proper test mail with SMTP and also PHP's mail() function.

 

Am totally confused with this order mails. 

 

It'll be great if i get any clue.

Share this post


Link to post
Share on other sites

I would try with an own test customer, create an order and check all important order stats. You should then  receive the emails for your test customer. I'd assume you won't get these because the corresponding function usually aborts when the corrupted message appears.

@Scully, 

 

Am doing the same thing as u suggested. Not receiving any order mails as test customer also.

Share this post


Link to post
Share on other sites

This is probably the piece of code which throws the error and then aborts:

        if (!is_array($to) && !Validate::isEmail($to)) {
            Tools::dieOrLog(Tools::displayError('Error: parameter "to" is corrupted'), $die);
            return false;
        }

It's from within the mail send function which has these parameters:

    public static function Send($id_lang, $template, $subject, $template_vars, $to,
        $to_name = null, $from = null, $from_name = null, $file_attachment = null, $mode_smtp = null,
        $template_path = _PS_MAIL_DIR_, $die = false, $id_shop = null, $bcc = null, $reply_to = null)
    {

with one big question: What triggers the mail send function without the recipient ( "to" parameter) is set?

Edited by Scully (see edit history)

Share this post


Link to post
Share on other sites

Loud thinking ....

 

What triggers the mail send function without the recipient ( "to" parameter) is set or the mail address is invalid?

 

Questions:

1. Have you overrides installed? If yes, what for?

2. Which mail method do you use?

3. Is it possible you haven't copied all files?

4. Check your error log. The most important thing now. What does it say?

Share this post


Link to post
Share on other sites

Loud thinking ....

 

What triggers the mail send function without the recipient ( "to" parameter) is set or the mail address is invalid?

 

Questions:

1. Have you overrides installed? If yes, what for?

2. Which mail method do you use?

3. Is it possible you haven't copied all files?

4. Check your error log. The most important thing now. What does it say?

@Scully

 

Answers as follows of your questions.

 

1. Have you overrides installed? If yes, what for?

Have installed Seller Module of knowband. But i don't think issue is with this.

 

2. Which mail method do you use?

Using PHP mail(). But tried with SMTP also facing same issue

 

3. Is it possible you haven't copied all files?

I have copied all files.

 

4. Check your error log. The most important thing now. What does it say?

Now Error log is showing: Warning: Invalid argument supplied for foreach() in /home/brand17/public_html/modules/mailalerts/MailAlert.php on line 173

 

Following code is on line no 173

		foreach ($customers as $customer)
		{
			$id_shop = (int)$customer['id_shop'];
			$id_lang = (int)$customer['id_lang'];
			$context->shop->id = $id_shop;
			$context->language->id = $id_lang;

			$product = new Product((int)$id_product, false, $id_lang, $id_shop);
			$product_link = $link->getProductLink($product, $product->link_rewrite, null, null, $id_lang, $id_shop);
			$template_vars = array(
				'{product}' => (is_array($product->name) ? $product->name[$id_lang] : $product->name),
				'{product_link}' => $product_link
			);

Share this post


Link to post
Share on other sites

Seems like the customer array or object is empty, whatever the reason causes this.

 

PHP incompatibility, missing files...?

Share this post


Link to post
Share on other sites

Seems like the customer array or object is empty, whatever the reason causes this.

 

PHP incompatibility, missing files...?

Might be files are missing.. 

 

Should i replace all files of same PS version? Or any other solution should i try.

 

Now MailAlerts error is not showing.

Share this post


Link to post
Share on other sites

If MailAlrts does not log erros, try again with a test customer order.

 

The first candidates Mail.php and Mailalert.php seem not to produce the bug "on their own". Some pre-conditions seem not to be met do finish the mail-job without problems.

 

Overall it's difficult to give a direction. Obiously the problem startet to develop after you swtiched your hosting. I would probably run a file compare between the old and the new server in order to figure out if there are differences in files.

Share this post


Link to post
Share on other sites

If MailAlrts does not log erros, try again with a test customer order.

 

The first candidates Mail.php and Mailalert.php seem not to produce the bug "on their own". Some pre-conditions seem not to be met do finish the mail-job without problems.

 

Overall it's difficult to give a direction. Obiously the problem startet to develop after you swtiched your hosting. I would probably run a file compare between the old and the new server in order to figure out if there are differences in files.

HI,

 

I have Found something.

 

Its look like my modules are working via public_html/modules not via public_html/themes/theme1/modules.

 

And this might be a reason for this.

 

So how to make modules to be work via public_html/themes/theme1/modules only. I think this might solve my problem.

Share this post


Link to post
Share on other sites

How did you come to the conclusion your modules path is wrong? Or in other words... prestashop doesn't change a path on its own.

And at this time, a link to your shop might be helpful.

Edited by Scully (see edit history)

Share this post


Link to post
Share on other sites

How did you come to the conclusion your modules path is wrong? Or in other words... prestashop doesn't change a path on its own.

And at this time, a link to your shop might be helpful.

 

Because All new installed module before migration were going automatically to public_html/themes/theme1/modules now new modules installing are being under public_html/modules

 

My Site URL: www.brand17.com

Edited by Devendra1203 (see edit history)

Share this post


Link to post
Share on other sites

I hate to say this, but it would be helpful to get all critical information at the beginning.

 

Till yesterday mail was working fine. But now facing a weird issue.

 

does not really fit with the information of a migration which has taken place:

 

All new installed module before migration were going automatically

Check you error logfile an post all lines which for the last 2 or 3 days which contain the string "php".

Share this post


Link to post
Share on other sites

hello, 

since few days i have exactly same problem !

what is stange , status in orders lits are corrupted, when i put manually order state to payment accepted mail is sent !

any idea ? 

thanks

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More