diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 52957d25343..e36327be432 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -78,6 +78,14 @@ $result = restrictedArea($user, 'contact', $id, 'socpeople&societe', '', '', 'ro // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('contactcard','globalcard')); +if ($id > 0) $object->fetch($id); + +if (! ($object->id > 0) && $action == 'view') +{ + $langs->load("errors"); + print($langs->trans('ErrorRecordNotFound')); + exit; +} /* * Actions