diff --git a/classes/submission/Collector.php b/classes/submission/Collector.php index 48c799229e..535e6cab73 100644 --- a/classes/submission/Collector.php +++ b/classes/submission/Collector.php @@ -1,4 +1,5 @@ selectRaw('NULL AS submission_id')->whereRaw('1 = 0'); + + $q->whereIn('s.submission_id', function (Builder $query) { + $context = Application::get()->getRequest()->getContext(); + + $query->when($context->isDoiTypeEnabled(Repo::doi()::TYPE_REPRESENTATION), function (Builder $q) { + $q->select('p.submission_id') + ->from('publication_galleys AS g') + ->join('dois AS d', 'g.doi_id', '=', 'd.doi_id') + ->join('publications AS p', 'g.publication_id', '=', 'p.publication_id') + ->whereLike('d.doi', "{$this->searchPhrase}%"); + }) + ->when($context->isDoiTypeEnabled(Repo::doi()::TYPE_PUBLICATION), function (Builder $q) { + $q->union(function (Builder $query) { + $query->select('p.submission_id') + ->from('publications AS p') + ->join('dois AS d', 'p.doi_id', '=', 'd.doi_id') + ->whereLike('d.doi', "{$this->searchPhrase}%"); + }); + }); + }); + } } diff --git a/lib/pkp b/lib/pkp index b48b679bf1..1369d89b60 160000 --- a/lib/pkp +++ b/lib/pkp @@ -1 +1 @@ -Subproject commit b48b679bf1ac19112641b8d0c8599121b6efa6ae +Subproject commit 1369d89b607c5dd5f407efd763b1c6d2f3599c4d