diff --git a/lib/Project.php b/lib/Project.php index 48fc5b2b..87817765 100644 --- a/lib/Project.php +++ b/lib/Project.php @@ -780,12 +780,12 @@ final class Project{ /** * @throws Exceptions\ProjectNotFoundException If the `Project` can't be found. */ - public static function GetByIdentifierAndIsInProgress(?string $identifier): Project{ + public static function GetByIdentifierAndIsActive(?string $identifier): Project{ if($identifier === null){ throw new Exceptions\ProjectNotFoundException(); } - return Db::Query('SELECT Projects.* from Ebooks inner join Projects using (EbookId) where Ebooks.Identifier = ? and Projects.Status = ?', [$identifier, Enums\ProjectStatusType::InProgress], Project::class)[0] ?? throw new Exceptions\ProjectNotFoundException(); + return Db::Query('SELECT Projects.* from Ebooks inner join Projects using (EbookId) where Ebooks.Identifier = ? and Projects.Status in (?, ?, ?)', [$identifier, Enums\ProjectStatusType::InProgress, Enums\ProjectStatusType::AwaitingReview, Enums\ProjectStatusType::Reviewed], Project::class)[0] ?? throw new Exceptions\ProjectNotFoundException(); } /** diff --git a/www/projects/reviewer/get.php b/www/projects/reviewer/get.php index 0f6a7793..2d880079 100644 --- a/www/projects/reviewer/get.php +++ b/www/projects/reviewer/get.php @@ -5,7 +5,7 @@ try{ if($urlPath !== null){ $identifier = EBOOKS_IDENTIFIER_PREFIX . trim(str_replace('.', '', $urlPath), '/'); // Contains the portion of the URL (without query string) that comes after `https://standardebooks.org/ebooks/`. - $project = Project::GetByIdentifierAndIsInProgress($identifier); + $project = Project::GetByIdentifierAndIsActive($identifier); } else{ $project = Project::Get(HttpInput::Int(GET, 'project-id'));