Skip to content
Snippets Groups Projects
Commit 05e4b331 authored by Stefan Galinski's avatar Stefan Galinski :video_game:
Browse files

[BUGFIX] Fix some possible crashes

parent 74d5155e
No related branches found
No related tags found
No related merge requests found
......@@ -349,14 +349,15 @@ class JoblistController extends ActionController {
'&tx_sgjobs_jobapplication[jobId]=' . $jobId
);
$headTagService->execute();
$enableAutomaticRelatedJobs = (bool) $this->settings['enableAutomaticRelatedJobs'];
if ($enableAutomaticRelatedJobs) {
$automaticRelatedJobsLimit = (int) $this->settings['automaticRelatedJobsLimit'];
$relatedJobs = $this->jobRepository->findRelated($job, $automaticRelatedJobsLimit);
$this->view->assign('relatedJobs', $relatedJobs);
}
}
$this->view->assign('job', $job);
$enableAutomaticRelatedJobs = (bool) $this->settings['enableAutomaticRelatedJobs'];
$automaticRelatedJobsLimit = (int) $this->settings['automaticRelatedJobsLimit'];
if ($enableAutomaticRelatedJobs) {
$relatedJobs = $this->jobRepository->findRelated($job, $automaticRelatedJobsLimit);
$this->view->assign('relatedJobs', $relatedJobs);
}
} else {
$storagePid = (int) $this->configurationManager->getConfiguration(
ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK
......@@ -384,7 +385,6 @@ class JoblistController extends ActionController {
$this->view->assign('allowedFileExtensions', $allowedFileExtensions);
if ($applyData === NULL) {
/** @noinspection CallableParameterUseCaseInTypeContextInspection */
$applyData = $this->objectManager->get(JobApplication::class);
if ($job) {
$applyData->setJobId($job->getJobId());
......@@ -498,6 +498,7 @@ class JoblistController extends ActionController {
$this->moveTmpFolder($folderName, $applyData);
$this->submitApplicationFiles($applyData, $folderName);
/** @noinspection PhpParamsInspection */
$mailService = $this->objectManager->get(
MailTemplateService::class,
'application_mail',
......@@ -719,12 +720,20 @@ class JoblistController extends ActionController {
/** @var ResourceFactory $resourceFactory */
$resourceFactory = GeneralUtility::makeInstance(ResourceFactory::class);
$storage = $resourceFactory->getStorageObject(1);
$newFolder = $tempFolder = NULL;
$folder = $storage->getFolder(UploadController::JOB_APPLICATION_FOLDER);
$tempFolder = $storage->getFolderInFolder(UploadController::JOB_APPLICATION_TEMP_FOLDER, $folder);
if (!$storage->hasFolderInFolder($folderName, $folder)) {
$newFolder = $storage->createFolder($folderName, $folder);
} else {
$newFolder = $storage->getFolder(UploadController::JOB_APPLICATION_FOLDER . $folderName);
if ($folder) {
$tempFolder = $storage->getFolderInFolder(UploadController::JOB_APPLICATION_TEMP_FOLDER, $folder);
if (!$storage->hasFolderInFolder($folderName, $folder)) {
$newFolder = $storage->createFolder($folderName, $folder);
} else {
$newFolder = $storage->getFolder(UploadController::JOB_APPLICATION_FOLDER . $folderName);
}
}
if (!$newFolder || !$tempFolder) {
throw new \RuntimeException('Upload folder can\'t be created (write permissions?)!');
}
// Move uploaded files & csv fo real folder and delete the tmp folder
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment