Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkp/pkp-lib#7563 Activitiy Log fails to load when certain values are null due to insufficient error handling in lib/pkp/classes/services/PKPSubmissionFileService.inc.php #8208

Open
wants to merge 1 commit into
base: stable-3_3_0
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions classes/services/PKPSubmissionFileService.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -768,15 +768,16 @@ public function getWorkflowStageId($submissionFile) {
case SUBMISSION_FILE_INTERNAL_REVIEW_REVISION:
$reviewRoundDao = DAORegistry::getDAO('ReviewRoundDAO'); /* @var $reviewRoundDao ReviewRoundDAO */
$reviewRound = $reviewRoundDao->getBySubmissionFileId($submissionFile->getId());
if (is_null($reviewRound)) return null;
return $reviewRound->getStageId();
case SUBMISSION_FILE_QUERY:
if ($submissionFile->getData('assocType') != ASSOC_TYPE_NOTE) return null;
$noteDao = DAORegistry::getDAO('NoteDAO'); /* @var $noteDao NoteDAO */
$note = $noteDao->getById($submissionFile->getData('assocId'));
if (!$note) {
return null;
}
if (!$note) return null;
$queryDao = DAORegistry::getDAO('QueryDAO'); /* @var $queryDao QueryDAO */
$query = $queryDao->getById($note->getAssocId());
if ($query == null or $query->getAssocType() != ASSOC_TYPE_QUERY) return null;
return $query ? $query->getStageId() : null;
}
throw new \Exception('Could not determine the workflow stage id from submission file ' . $submissionFile->getId() . ' with file stage ' . $submissionFile->getData('fileStage'));
Expand Down