Better error messages

This commit is contained in:
Laurent Destailleur 2018-01-27 18:46:52 +01:00
parent 6cae36cc33
commit f2a3c83053
2 changed files with 5 additions and 4 deletions

View File

@ -211,7 +211,7 @@ if ($id > 0 && empty($object->id))
{ {
// Load data of third party // Load data of third party
$res=$object->fetch($id); $res=$object->fetch($id);
if ($object->id <= 0) dol_print_error($db,$object->error,$object->errors); if ($object->id < 0) dol_print_error($db, $object->error, $object->errors);
} }
$title=$langs->trans("CustomerCard"); $title=$langs->trans("CustomerCard");
@ -220,7 +220,7 @@ $help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
llxHeader('',$title,$help_url); llxHeader('',$title,$help_url);
if ($id > 0) if ($object->id > 0)
{ {
$head = societe_prepare_head($object); $head = societe_prepare_head($object);
@ -1271,7 +1271,8 @@ if ($id > 0)
} }
else else
{ {
dol_print_error($db,'Bad value for socid parameter'); $langs->load("errors");
print $langs->trans('ErrorRecordNotFound');
} }
// End of page // End of page

View File

@ -268,7 +268,7 @@ if ($type_element == 'supplier_order')
$thirdTypeSelect='supplier'; $thirdTypeSelect='supplier';
} }
if ($type_element == 'contract') if ($type_element == 'contract')
{ // Supplier : Show products from orders. { // Order
require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
$documentstatic=new Contrat($db); $documentstatic=new Contrat($db);
$documentstaticline=new ContratLigne($db); $documentstaticline=new ContratLigne($db);