From e4ec14767f907c7252ad8c38e9e49e5f5b323950 Mon Sep 17 00:00:00 2001 From: Art4 Date: Mon, 18 Nov 2024 08:39:06 +0000 Subject: [PATCH] Refactor module Item Display --- src/Module/Item/Display.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Module/Item/Display.php b/src/Module/Item/Display.php index fbc977105b..cca2dbf3a2 100644 --- a/src/Module/Item/Display.php +++ b/src/Module/Item/Display.php @@ -165,12 +165,13 @@ class Display extends BaseModule */ protected function displaySidebar(array $item) { + $author = []; $shared = $this->contentItem->getSharedPost($item, ['author-link']); - if (!empty($shared) && empty($shared['comment'])) { + if (count($shared) > 0 && !array_key_exists('comment', $shared)) { $author = Contact::getByURLForUser($shared['post']['author-link'], $this->session->getLocalUserId()); } - if (empty($contact)) { + if ($author === []) { $author = Contact::getById($item['author-id']); }