diff --git a/TextureHandler.inc.php b/TextureHandler.inc.php index 8073467..caa8b8c 100644 --- a/TextureHandler.inc.php +++ b/TextureHandler.inc.php @@ -374,7 +374,7 @@ public function media($args, $request) { */ protected function _createDependentFile($genreId, $mediaData, $submission, $submissionFile, $user) { $mediaBlob = base64_decode(preg_replace('#^data:\w+/\w+;base64,#i', '', $mediaData["data"])); - return $this->_plugin->createDependentFile($genreId, $mediaBlob, $submission, $submissionFile, $user); + return $this->_plugin->createDependentFile($genreId, $mediaBlob, $submission, $submissionFile, $user->getId()); } /** @@ -389,7 +389,7 @@ protected function _createDependentFile($genreId, $mediaData, $submission, $subm */ protected function _updateManuscriptFile($fileStage, $genreId, $resources, $submission, $submissionFile, $user) { $manuscriptXml = $resources['manuscript.xml']->data; - return $this->_plugin->updateManuscriptFile($fileStage, $genreId, $manuscriptXml, $submission, $submissionFile, $user); + return $this->_plugin->updateManuscriptFile($fileStage, $genreId, $manuscriptXml, $submission, $submissionFile, $user->getId()); } /** diff --git a/TexturePlugin.inc.php b/TexturePlugin.inc.php index bc76eb5..ec1f0cb 100644 --- a/TexturePlugin.inc.php +++ b/TexturePlugin.inc.php @@ -141,10 +141,10 @@ public function templateFetchCallback($hookName, $params) { * @param $mediaData string Dependent media file contents * @param $submission Submission Submission to which to attach the dependent file * @param $submissionFile SubmissionFile Submission file to which to attach the dependent file - * @param $user User Submitting user + * @param $userid int Submitting user * @return SubmissionArtworkFile */ - public function createDependentFile($genreId, $mediaData, $submission, $submissionFile, $user) { + public function createDependentFile($genreId, $mediaData, $submission, $submissionFile, $userid) { $tmpfname = tempnam(sys_get_temp_dir(), 'texture'); file_put_contents($tmpfname, $mediaData); @@ -156,7 +156,7 @@ public function createDependentFile($genreId, $mediaData, $submission, $submissi $newMediaFile->setFileStage(SUBMISSION_FILE_DEPENDENT); $newMediaFile->setDateUploaded(Core::getCurrentDate()); $newMediaFile->setDateModified(Core::getCurrentDate()); - $newMediaFile->setUploaderUserId($user->getId()); + $newMediaFile->setUploaderUserId($userid); $newMediaFile->setFileSize(filesize($tmpfname)); $newMediaFile->setFileType($mediaData["fileType"]); $newMediaFile->setAssocId($submissionFile->getFileId()); @@ -176,10 +176,10 @@ public function createDependentFile($genreId, $mediaData, $submission, $submissi * @param $manuscriptXml string Manuscript XML content * @param $submission Submission Submission to which to attach the new SubmissionFile * @param $submissionFile SubmissionFile Original submission file to update - * @param $user User Submitting user + * @param $userid User Submitting user * @return SubmissionFile */ - public function updateManuscriptFile($fileStage, $genreId, $manuscriptXml, $submission, $submissionFile, $user) { + public function updateManuscriptFile($fileStage, $genreId, $manuscriptXml, $submission, $submissionFile, $userid) { $tmpfname = tempnam(sys_get_temp_dir(), 'texture'); file_put_contents($tmpfname, $manuscriptXml); @@ -196,7 +196,7 @@ public function updateManuscriptFile($fileStage, $genreId, $manuscriptXml, $subm $newSubmissionFile->setDateUploaded(Core::getCurrentDate()); $newSubmissionFile->setDateModified(Core::getCurrentDate()); $newSubmissionFile->setOriginalFileName($submissionFile->getOriginalFileName()); - $newSubmissionFile->setUploaderUserId($user->getId()); + $newSubmissionFile->setUploaderUserId($userid); $newSubmissionFile->setFileSize($fileSize); $newSubmissionFile->setFileType($submissionFile->getFileType()); $newSubmissionFile->setSourceFileId($submissionFile->getFileId());