Devendra1203 Posted August 28, 2017 Share Posted August 28, 2017 (edited) 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 August 28, 2017 by Devendra1203 (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted August 28, 2017 Share Posted August 28, 2017 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 ? Link to comment Share on other sites More sharing options...
Scully Posted August 28, 2017 Share Posted August 28, 2017 (edited) 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 August 28, 2017 by Scully (see edit history) Link to comment Share on other sites More sharing options...
Devendra1203 Posted August 28, 2017 Author Share Posted August 28, 2017 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. Link to comment Share on other sites More sharing options...
Devendra1203 Posted August 28, 2017 Author Share Posted August 28, 2017 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. Link to comment Share on other sites More sharing options...
Scully Posted August 28, 2017 Share Posted August 28, 2017 (edited) 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 August 28, 2017 by Scully (see edit history) Link to comment Share on other sites More sharing options...
Scully Posted August 28, 2017 Share Posted August 28, 2017 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? Link to comment Share on other sites More sharing options...
Devendra1203 Posted August 28, 2017 Author Share Posted August 28, 2017 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 ); Link to comment Share on other sites More sharing options...
Scully Posted August 28, 2017 Share Posted August 28, 2017 Seems like the customer array or object is empty, whatever the reason causes this. PHP incompatibility, missing files...? Link to comment Share on other sites More sharing options...
Devendra1203 Posted August 28, 2017 Author Share Posted August 28, 2017 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. Link to comment Share on other sites More sharing options...
Scully Posted August 29, 2017 Share Posted August 29, 2017 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. Link to comment Share on other sites More sharing options...
Devendra1203 Posted August 31, 2017 Author Share Posted August 31, 2017 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. Link to comment Share on other sites More sharing options...
Scully Posted August 31, 2017 Share Posted August 31, 2017 (edited) 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 August 31, 2017 by Scully (see edit history) Link to comment Share on other sites More sharing options...
Devendra1203 Posted August 31, 2017 Author Share Posted August 31, 2017 (edited) 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 August 31, 2017 by Devendra1203 (see edit history) Link to comment Share on other sites More sharing options...
Scully Posted August 31, 2017 Share Posted August 31, 2017 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". Link to comment Share on other sites More sharing options...
abouzouzou Posted July 18, 2020 Share Posted July 18, 2020 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 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now