diff --git a/classes/submission/Submission.inc.php b/classes/submission/Submission.inc.php index 6433d28a3b..ad3b96289c 100644 --- a/classes/submission/Submission.inc.php +++ b/classes/submission/Submission.inc.php @@ -252,13 +252,15 @@ function getTotalGalleyViews() { $application = Application::get(); $publications = $this->getPublishedPublications(); $views = 0; + $fileIds = []; foreach ($publications as $publication) { foreach ((array) $publication->getData('galleys') as $galley) { $file = $galley->getFile(); - if (!$galley->getRemoteUrl() && $file) { + if (!$galley->getRemoteUrl() && $file && !in_array($file->getId(), $fileIds)) { $views = $views + $application->getPrimaryMetricByAssoc(ASSOC_TYPE_SUBMISSION_FILE, $file->getId()); - } + $fileIds[] = $file->getId(); + } } } return $views;