Skip to content

Commit

Permalink
Fixed: related to commit #049ac4f06f068c8ef9ae2c1b30b38b679a9f1640: a…
Browse files Browse the repository at this point in the history
…pplication error: Call to a member function getVersionsIds() on bool.
  • Loading branch information
devletech committed Sep 27, 2024
1 parent 049ac4f commit e460cf6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion library/Episciences/Paper/ConflictsManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,20 @@ 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 = [];
$db = Zend_Db_Table_Abstract::getDefaultAdapter();
$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);
Expand Down
2 changes: 1 addition & 1 deletion library/Episciences/PapersManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));

}

Expand Down

0 comments on commit e460cf6

Please sign in to comment.