FIX Calling soc.php with an unknown socid display a message

Fix #4632
Calling soc.php with an unknown socid display a simple error message
This commit is contained in:
Jean-Pierre Morfin 2016-12-10 11:49:16 +01:00 committed by GitHub
parent bd1d076753
commit 4b4dc8fe0d

View File

@ -72,6 +72,12 @@ $extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('thirdpartycard','globalcard'));
if ($action == 'view' && $object->fetch($socid)<=0)
{
$langs->load("errors");
print($langs->trans('ErrorRecordNotFound'));
exit;
}
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
$object->getCanvas($socid);