-
Notifications
You must be signed in to change notification settings - Fork 474
[Public Peer Reviews Summary] | API, returns incorrect version info for current published version #12284
Description
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:
pkp-lib/api/v1/peerReviews/resources/PublicationPeerReviewSummaryResource.php
Lines 47 to 60 in 2fa251e
| $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 |
pkp-lib/api/v1/peerReviews/resources/SubmissionPeerReviewSummaryResource.php
Lines 42 to 53 in 2fa251e
| $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
- Identify a submission where the latest published version is different from the current publication
- Call the summary endpoint, example :
localhost:8000/index.php/publicknowledge/api/v1/peerReviews/open/submissions/13/summary - Notice the data returned in
submissionCurrentVersionis 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
Type
Projects
Status