12725 - add error_log in mailjet deleteContact()

This commit is contained in:
Rodney Figaro 2017-03-10 16:46:44 +01:00
parent 460cffe7ca
commit 5501668868
2 changed files with 11 additions and 4 deletions

View File

@ -3317,20 +3317,24 @@ class AdminControllerCore extends Controller
$delete_ok = false;
}
}
else
else {
if (!$to_delete->delete())
{
$result = false;
$delete_ok = false;
}
}
if ($delete_ok)
if ($delete_ok) {
PrestaShopLogger::addLog(sprintf($this->l('%s deletion', 'AdminTab', false, false), $this->className), 1, null, $this->className, (int)$to_delete->id, true, (int)$this->context->employee->id);
else
}
else {
$this->errors[] = sprintf(Tools::displayError('Can\'t delete #%d'), $id);
}
}
if ($result)
if ($result) {
$this->redirect_after = self::$currentIndex.'&conf=2&token='.$this->token;
}
$this->errors[] = Tools::displayError('An error occurred while deleting this selection.');
}
}

View File

@ -591,12 +591,15 @@ class Mailjet_Sync extends Module
}
$mj = $this->getClient();
if ($mj->deleteContactFromList($customer->email, $list, $remove) && $mj->deleteContactFromList($customer->email, $list2, $remove)) {
error_log('ANTADIS DEBUG MAIJET - OK - Delete contact from list Q/H/3 : '.print_r($list, true).' - list Pro/Part : '.print_r($list2, true));
if ($remove == 1) {
$mj->deleteContactFromList($customer->email, Configuration::get('MAILJETSYNC_LIST_ID'), $remove);
$mj->deleteContactFromList($customer->email, Configuration::get('MAILJETSYNC_LIST_ID_PRO'), $remove);
error_log('ANTADIS DEBUG MAIJET - OK - Redondant delete contact from both Pro/part lists');
}
return true;
} else {
error_log('ANTADIS DEBUG MAIJET - FAIL - Delete contact from list Q/H/3 : '.print_r($list, true).' - list Pro/Part : '.print_r($list2, true));
return false;
}
}