Skip to content

Commit

Permalink
Merge pull request pkp#219 from pkp/i8092-fix
Browse files Browse the repository at this point in the history
pkp/pkp-lib#8092 Refactor entity collector to use more intuitive syntax
  • Loading branch information
asmecher authored Aug 19, 2022
2 parents 437ca75 + a284fc5 commit 21656e2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
17 changes: 7 additions & 10 deletions OrcidProfilePlugin.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -838,11 +838,9 @@ public function handleEditorAction($hookName, $args)
$publication = $submission->getCurrentPublication();

if (isset($publication)) {
$authors = Repo::author()->getMany(
Repo::author()
->getCollector()
->filterByPublicationIds([$submission->getCurrentPublication()->getId()])
);
$authors = Repo::author()->getCollector()
->filterByPublicationIds([$submission->getCurrentPublication()->getId()])
->getMany();

foreach ($authors as $author) {
$orcidAccessExpiresOn = Carbon\Carbon::parse($author->getData('orcidAccessExpiresOn'));
Expand Down Expand Up @@ -883,11 +881,10 @@ public function sendSubmissionToOrcid($publication, $request)
$issue = Repo::issue()->get($issueId);
}

$authors = Repo::author()->getMany(
Repo::author()
->getCollector()
->filterByPublicationIds([$publicationId])
);
$authors = Repo::author()
->getCollector()
->filterByPublicationIds([$publicationId])
->getMany();

// Collect valid ORCID ids and access tokens from submission contributors
$authorsWithOrcid = [];
Expand Down
9 changes: 4 additions & 5 deletions pages/OrcidHandler.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,10 @@ public function orcidVerify($args, $request)


$publicationId = $request->getUserVar('publicationId');
$authors = Repo::author()->getMany(
Repo::author()
->getCollector()
->filterByPublicationIds([$publicationId])
);
$authors = Repo::author()
->getCollector()
->filterByPublicationIds([$publicationId])
->getMany();

$publication = Repo::publication()->get($publicationId);

Expand Down

0 comments on commit 21656e2

Please sign in to comment.