Skip to content

[Public Peer Reviews Summary] | API, returns incorrect version info for current published version #12284

@taslangraham

Description

@taslangraham

Valid Title

  • I have updated the title to accurately reflect the bug description

Description

The public peer review summary endpoints(peerReviews/open/publications/{publicationId}/summary & peerReviews/open/submissions/{submissionId}/summary) returns a property, submissionCurrentVersion, that should contain information about the latest published publication version of the submission the peer reviews are associated with. However, the information return is the current publication of the submission instead of the latest published publication. This should the be updated to return the correct data.

Code in question:

$currentPublication = $submission->getCurrentPublication();
$publishedPublications = $submission->getPublishedPublications();
return [
'publicationId' => $publication->getId(),
'reviewerRecommendations' => $this->getReviewerRecommendationsSummary($reviewAssignments, $context),
// Number of published versions of the publication's submission
'submissionPublishedVersionsCount' => count($publishedPublications),
'reviewerCount' => $this->getReviewerCount($reviewAssignments),
// Latest published publication for the submission associated with this publication
'submissionCurrentVersion' => $currentPublication ? [
'title' => $currentPublication->getLocalizedTitle(),
'datePublished' => $currentPublication->getData('datePublished'),
] : null

$currentPublication = $submission->getCurrentPublication();
return [
'submissionId' => $submission->getId(),
'reviewerRecommendations' => $this->getReviewerRecommendationsSummary($reviewAssignments, $context),
'submissionPublishedVersionsCount' => count($submission->getPublishedPublications()),
'reviewerCount' => $this->getReviewerCount($reviewAssignments),
'submissionCurrentVersion' => $currentPublication ? [
'title' => $currentPublication->getLocalizedTitle(),
'datePublished' => $currentPublication->getData('datePublished'),
] : null,
];

Steps to Reproduce

  1. Identify a submission where the latest published version is different from the current publication
  2. Call the summary endpoint, example : localhost:8000/index.php/publicknowledge/api/v1/peerReviews/open/submissions/13/summary
  3. Notice the data returned in submissionCurrentVersion is for the current publication instead of the latest published version

Expected Result

The submissionCurrentVersion field should have data for the latest published version

Actual Result

API returns information for the current publication version

Environment Details

No response

Application Version

OJS 3.6

Logs

No response

Additional Information

No response

Pull Requests
pkp-lib: #12285
ojs(submodule update): pkp/ojs#5312
ops(submodule update): pkp/ops#1189
omp(submodule update): pkp/omp#2219

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions