From fced9ec690d2eccfbcd6486cded46ad184e58cdb Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 27 Oct 2019 12:04:01 +0100 Subject: [PATCH] Fix missing contact fetch on card --- htdocs/contact/card.php | 8 ++++++++ 1 file changed, 8 insertions(+) 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