From e460cf6913e38c8d147bb5b0cf4b07dadbd53a0a Mon Sep 17 00:00:00 2001 From: Djamel Chibane <20502173+devletech@users.noreply.github.com> Date: Fri, 27 Sep 2024 12:28:16 +0200 Subject: [PATCH] Fixed: related to commit #049ac4f06f068c8ef9ae2c1b30b38b679a9f1640: application error: Call to a member function getVersionsIds() on bool. --- library/Episciences/Paper/ConflictsManager.php | 5 ++++- library/Episciences/PapersManager.php | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/library/Episciences/Paper/ConflictsManager.php b/library/Episciences/Paper/ConflictsManager.php index 28aaf10d1..0fb637c3b 100644 --- a/library/Episciences/Paper/ConflictsManager.php +++ b/library/Episciences/Paper/ConflictsManager.php @@ -7,9 +7,10 @@ class Episciences_Paper_ConflictsManager /** * @param int $paperId + * @param int $rvId * @return Episciences_Paper_Conflict [] */ - public static function findByPaperId(int $paperId): array + public static function findByPaperId(int $paperId, int $rvId = RVID): array { $oResult = []; @@ -17,7 +18,9 @@ public static function findByPaperId(int $paperId): array $sql = $db->select() ->from(['c' => self::TABLE]) ->join(['u' => T_USERS], 'u.UID = c.by', ['SCREEN_NAME']) + ->join(['ur' => T_USER_ROLES], 'ur.UID = u.UID') ->where('paper_id = ?', $paperId) + ->where('ur.RVID = ?', $rvId) ->order('date DESC'); $rows = $db->fetchAssoc($sql); diff --git a/library/Episciences/PapersManager.php b/library/Episciences/PapersManager.php index 014b3865a..876877d98 100644 --- a/library/Episciences/PapersManager.php +++ b/library/Episciences/PapersManager.php @@ -2151,7 +2151,7 @@ public static function get($docId, bool $withxsl = true, int $rvId = null) $paper = new Episciences_Paper(array_merge($data, ['withxsl' => $withxsl])); $paper->setRevisionDeadline(); - return $paper->setConflicts(Episciences_Paper_ConflictsManager::findByPaperId($paper->getPaperid())); + return $paper->setConflicts(Episciences_Paper_ConflictsManager::findByPaperId($paper->getPaperid(), $rvId)); }