Skip to content

Commit

Permalink
pkp#10814 Log file deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
taslangraham committed Feb 25, 2025
1 parent b63392c commit 300cfa9
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion classes/submissionFile/Repository.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @file classes/submissionFile/Repository.php
*
Expand Down Expand Up @@ -26,9 +27,9 @@
use PKP\core\Core;
use PKP\core\PKPApplication;
use PKP\db\DAORegistry;
use PKP\log\event\SubmissionFileEventLogEntry;
use PKP\log\SubmissionEmailLogDAO;
use PKP\log\SubmissionEmailLogEntry;
use PKP\log\event\SubmissionFileEventLogEntry;
use PKP\mail\mailables\RevisedVersionNotify;
use PKP\note\NoteDAO;
use PKP\notification\PKPNotification;
Expand Down Expand Up @@ -505,6 +506,20 @@ public function delete(SubmissionFile $submissionFile): void
));
Repo::eventLog()->add($logEntry);

$submission = Repo::submission()->get($submissionFile->getData('submissionId'));
$logEntry = Repo::eventLog()->newDataObject(array_merge(
$this->getSubmissionFileLogData($submissionFile),
[
'assocType' => PKPApplication::ASSOC_TYPE_SUBMISSION,
'assocId' => $submission->getId(),
'eventType' => SubmissionFileEventLogEntry::SUBMISSION_LOG_FILE_DELETE,
'message' => 'submission.event.fileDeleted',
'isTranslated' => false,
'dateLogged' => Core::getCurrentDate(),
]
));
Repo::eventLog()->add($logEntry);

Hook::call('SubmissionFile::delete', [$submissionFile]);
}

Expand Down

0 comments on commit 300cfa9

Please sign in to comment.