From 26ae8279fd1c4ab59fc2285c0ba04bb4900109f2 Mon Sep 17 00:00:00 2001 From: Damien <damien.burel@maarch.org> Date: Mon, 4 Feb 2019 14:34:05 +0100 Subject: [PATCH] FEAT #9082 Summary sheet controller fix --- src/app/resource/controllers/SummarySheetController.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/resource/controllers/SummarySheetController.php b/src/app/resource/controllers/SummarySheetController.php index 8c588181fef..86ff54072c6 100644 --- a/src/app/resource/controllers/SummarySheetController.php +++ b/src/app/resource/controllers/SummarySheetController.php @@ -162,7 +162,9 @@ class SummarySheetController $creationdate = empty($creationdate) ? '<i>'._UNDEFINED.'</i>' : "<b>{$creationdate}</b>"; $docDate = TextFormatModel::formatDate($resource['doc_date'], 'd-m-Y'); $docDate = empty($docDate) ? '<i>'._UNDEFINED.'</i>' : "<b>{$docDate}</b>"; - $initiator = EntityModel::getByEntityId(['entityId' => $resource['initiator'], 'select' => ['short_label']]); + if (!empty($resource['initiator'])) { + $initiator = EntityModel::getByEntityId(['entityId' => $resource['initiator'], 'select' => ['short_label']]); + } $initiatorEntity = empty($initiator) ? '' : "({$initiator['short_label']})"; $typist = UserModel::getLabelledUserById(['login' => $resource['typist']]); $doctype = empty($resource['type_label']) ? '<i>'._UNDEFINED.'</i>' : "<b>{$resource['type_label']}</b>"; -- GitLab